posted 14 years ago
I'm trying to get the client IP for one of the methods in the web service, but the stated directions I've found don't seem to work.
Here's what I've done...
At the @WebService level, I've defined these:
@HandlerChain(file="handler-chain.xml")
// Enable dependency injection on web service context.
@Resource
WebServiceContext wsContex
----
Then, in the web service method, I try to get the message context like this:
@WebMethod
public ....
{
MessageContext msgCtxt = wsContext.getMessageContext();
...
}
===
The handler-chsin.xml file has this:
------
And the event MessageHandler code itself has this:
=====================
However, each time I run this from the client side, I get a NullPointerException on the ' MessageContext msgCtxt = wsContext.getMessageContext();' line of code.
I thought the @Resource would dependency-inject the context....???
So, how do I correctly get the client's IP?
I can't seem to find the documentation beyond what I've done here.
Do I need to re-generate the client or other code? The web service itself is automatically deployed.
Thanks in advance.
Mike