How to identify client calls from server side

we have a web service running in jboss as 4.2 and we have to check which client is accessing (just atleast one identity is enough). i.e. we there should be an indication that one client is accessing the web service in the console.

Is there any possibilities to get that client information form web service running console?

Hi!
Unless you enclose some information that helps you identify the client in requests to the server, I think the only piece of information giving information about the client is the IP address from which the request originates.
This is the "drawback" of web services - they are meant to be language and technology independent.
Best wishes!

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261

posted Aug 12, 2009 20:34:32

0

Hi Ivan,
Thanks for replying to my question. Atleast if I get that IPaddress or so information, thats enough to identify client.
Could you please give me a clue how to get that information.

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198

1

posted Aug 13, 2009 01:06:12

0

Hi!
Use the following procedure to be able to retrieve the IP address of the client, or the last proxy, form which the request was sent:
1. Have a WebServiceContext injected in the endpoint implementation class.
2. At request time, retrieve a MessageContext from the WebServiceContext.
3. From the MessageContext you can retrieve the servlet request object for the request using the MessageContext.SERVLET_REQUEST constant.
4. From the servlet request object you can retrieve the IP address using the ServletRequest.getRemoteAddress() method.
Best wishes!