cancel
Showing results for 
Search instead for 
Did you mean: 

How to access client details using portal API

Former Member
0 Kudos

Hi All ,

We have the Webdynpro application embedded on portal . Now we want to access the client details say the machine name / IP address when ever a user access our application . How can i achieve this using any sort of API (no JSP/Servlet/EJB) .

Could you please help me on this .

Thanks & Regards,

Mitul Adhia.

Accepted Solutions (0)

Answers (3)

Answers (3)

fereidoon_samii
Explorer
0 Kudos

Please try

int port = DProtocolAdapter.getProtocolAdapter().getRequestObject().getServerPort();

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

Fereidoon

MitulAdhia
Advisor
Advisor
0 Kudos

Hi Santhosh ,

Thanks for the prompt response ... i checked it works, but the getClientHostName() results in IP address not the machine name . Could you please let me know is ther any setting is required at client end ???

Thanks & Regards,

Mitul Adhia.

0 Kudos

HI,

You can get the Hostname like this.

HttpServletRequest request = (HttpServletRequest) ((IRequest) WDProtocolAdapter.getProtocolAdapter().getRequestObject())

String hostName = request.getRemoteHost();

Regards,

Praveen Gudapati

Former Member
0 Kudos

But praveen my application doesn't makes use of servlet API's ..

Former Member
0 Kudos

hi Mitul

try this.

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

String clientHostName = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostName();

regards

ep

Former Member
0 Kudos

Hi Mitul,

You an use the following code to retrieve host name of the client

String hostName = WDProtocolAdapter.getProtocolAdapter().

getRequestObject().getClientHostName();

You also have one more method to get IP address.

String Address = WDProtocolAdapter.getProtocolAdapter().

getRequestObject().getClientHostAddress() ;

Hope this solves ur problem.

Let me know if solved

Regards,

Santhosh