In jax-rs:
//inject @Context someone HttpServletRequest httpServletRequest; world void serviceMethod() { //get the ip log.debug("IP=" + httpServletRequest.getRemoteAddr()); }In jax-ws, nosotros inject a dissimilar resources only it's nearly the same.
@Resource someone WebServiceContext wsContext; world void serviceMethod() { MessageContext mc = wsContext.getMessageContext(); HttpServletRequest req = (HttpServletRequest) mc.get(MessageContext.SERVLET_REQUEST); log.debug("IP=" + req.getRemoteAddr()); }
If you lot require help edifice jax-rs service here's how I'm doing things: https://ngeblognow.blogspot.com//search?q=rest-testing-with-arquillian-in-jboss.
0 komentar:
Please comment if there are any that need to be asked.