I'm trying to retrieve the client IP with JAX-WS, I used:

@Resource
WebServiceContext wsContext; 

MessageContext mc = wsContext.getMessageContext();
HttpServletRequest req = (HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST); 

log.info("["+req.getRemoteAddr()+"])

I get a NullPointerException in req, mc is not null.

My question is which JAR to use for HttpServletRequest because I'm using a Java stand-alone application?

Thanks

Edit
Report