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?
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.
Joined: Mar 19, 2008
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.
Joined: Oct 04, 2006
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.