cancel
Showing results for 
Search instead for 
Did you mean: 

problem retriving system ip of the client machine in webdynpro

Former Member
0 Kudos

Dear Experts,

Can u give ur suggesions retriving client ip of the machine who log in portal.

try

{

InetAddress localHost = InetAddress.getLocalHost();

InetAddress[] all_IPs = InetAddress.getAllByName(localHost.getHostName());

for (int w=0; w<all_IPs.length; w++) {

System.out.println("IP address = " + all_IPs[w]);

wdComponentAPI.getMessageManager().reportSuccess(WDClientUser.getLoggedInClientUser().getFirstName());

}

}catch (Exception e) {

// TODO: handle exception

wdComponentAPI.getMessageManager().raiseException("Unable to get IP",false);

}

From above code i'm getting portal server ip.Iwant dynamic client system ip.In ABAP System we're getting IP From AL08 TCODE.But how in webdynpro java.

Thanks ,

Santhosh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Following code will help you


String ipAddress = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostAddress();

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

Did you test this from a client system?

What i mean here is your client and the server should not be the same.

Regards

Ayyapparaj

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All,

I set the sapauthentication property of that application as true and i configured that appilcation as URL iview .Presently i'm getting Client IP.

Thanks,

Santhosh

Former Member
0 Kudos

Hi Ayyapparaj,

Thanks for ur rpl.That Code is working.Actually we're using SAP Webdispatcher.That's why i'm getting Server ip.Can u suggest how can i proceed this scenario.If i give the port number,Client IP Is retriving.

Thanks,

Santhosh

Former Member
0 Kudos

Hi ,

what i mean is i need to get system ip of who ever accesing webdynpro iview from portal.If i work with above code i'm getting server ip.My portal is intranet portal.

I hope u got my point.If any doubt let me know.

Thanks for ur quick rpl.

Thanks,

Santhosh

Former Member
0 Kudos

Hi Ayyapparaj,

I tried with the same code.that is retriving server ip .I need Activer user IP who log in portal throgh webdynpro java application.

  • Iwill provide the points.It's urgent

sid_sunny
Contributor
0 Kudos

Hi,

Try this one I am also using this:

wdComponentAPI.getMessageManager().reportWarning(""+WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostName());

Regards

Siddharth Chauhan

Former Member
0 Kudos

Hi All,

I also tried the same code.. whenever i am running application from NWDS it is giving ip address of client.

If i try the same after creating an iview of application in portal and view with mozilla it is giving client ip address.

if i try with IE with a full portal url (along with port number 50300) it is giving client address. Otherwise(without port number) it is giving server ip address.

Is it require any other setting in dispatcher?

Regards

Baby

Edited by: Baby on May 27, 2008 12:17 PM