If you want the underlying information of who's calling your web service (say, the remote IP), the only way I know how to do it is to enable "Resource injection".
However, no matter what I do, it will not work.
Here's the setup code:
// Enable dependency injection on web service context.
@Resource
WebServiceContext wsContext;
at the top of a JAX-WS web service.
----------------------------------
Then, later in the web service code, inside a @WebMethod:
public
String getLatest()
{
/* NullPointerException happens here ---> */ MessageContext context = wsContext.getMessageContext();
.
.
.
}
???
When I run the client web service, I always get a NullPointerException as shown at the line above.
Web.xml seems to have the correct information in it so I'm totally stumped.
Has anyone gotten this working?
Thanks in advance.
Mike