users@glassfish.java.net

get the IP Adresses from the clients inside a webservice

From: <glassfish_at_javadesktop.org>
Date: Tue, 26 Jan 2010 06:04:21 PST

Hi_at_all,

how can i get the IP Adresses that calling my webservice ???
In this example i only get the Ip Adress from the webserver, but i want all ip adresses from that calling the webservice method !!

How can i do this ???


@WebService(serviceName = "Bla",
public class Bla extends BlaBla
{
    @Resource
    private WebServiceContext wsContext;

    @WebMethod(operationName = "bb")
    @WebResult(name = "bb", partName = "bb",
...................
{
            String sRemoteAdress = "";
            MessageContext mc = wsContext.getMessageContext();
            HttpServletRequest request = (HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST);
            sRemoteAdress = request.getRemoteAddr().toString();
.................

}

}
[Message sent by forum member 'mammutglassfish' (juppie76_at_gmx.de)]

http://forums.java.net/jive/thread.jspa?messageID=383022