@WebService()
public class Test {
@Resource
WebServiceContext context;
@WebMethod(operationName = "getInfo")
public String getInfo() {
HttpServletRequest request = (HttpServletRequest)context.getMessageContext()
.get(MessageContext.SERVLET_REQUEST);
return "IP: " + request.getRemoteAddr() +
", Port: " + request.getRemotePort() +
", Host: " + request.getRemoteHost();
}
}