• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to identify client calls from server side

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic