views:

778

answers:

3

Hi

We have a web service that is deployed on 2 separate machines in different locations. Is it possible to monitor the url that a person used to call our webservice using java code? We have a 3DNS url set up and we want all clients to use this url as oppossed hitting the boxes directly with the correct port numbers in the url.

Thanks Damien

A: 

You might look into something like OWSM (Oracle Web Services Manager)... there may be open source alternatives.

OWSM creates a virtual endpoint that it handles and routes to the actual service hosts. This way, your service hosts can be hidden behind the firewall, with only the OWSM host visible to the world. When a user hits the virtual endpoint, OWSM can authenticate and pass them along to the balanced service host.

Bill James
A: 

An alternative might be to use servlet filters on the real endpoints. The filter could do a couple of different things. It could simply log the requested URL from the HttpServletRequest, or it could even redirect to the correct URL for you (I'm not sure what the implications of that are for a web service, though).

All you would have to do is have the filter mapped to the same context path as the web service (axis uses /services/* for example).

Ian McLaird
+1  A: 

Have you taken a look at:

@Resource
WebServiceContext wsContext;

This will return the context of the current message sent to your webservice. I've been able to get the IP address of the user from that.

This is assuming that you are using Java.

monksy