Getting the IP Address Of A client For a webservice

Viewed 43394

I am using JAX-WS and I am having trouble retrieving the client information that is consuming a webservice. I've found out how to do it with JAX-RPC, and Apache Tomcat Axis, but not with JAX-WS. Does anyone have an idea about this?

4 Answers

Or this:

@Path("terminal")
public class terminal {
    @Context private javax.servlet.http.HttpServletRequest hsr;
    @GET
    @Path("get_ip")
    @Produces("text/plain")
    public String get_ip()
    {
            return ip = hsr.getRemoteAddr();
    }
}
Related