You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by dishmily <en...@hotmail.com> on 2009/09/23 12:00:16 UTC
Problem: get Client IP by using MessageContext
hello,
my web service uses axis2. i want to get the Client (IP), which invokes my
web service.
by using:
import org.apache.axis2.context.MessageContext;
IP = (String)
MessageContext.getCurrentMessageContext().getProperty("REMOTE_ADDR");
i got the result: IP= 0:0:0:0:0:0:0:1
what i wanted was that the result should be IP=127.0.0.1
can anyone tell me how can i get the right result?
--
View this message in context: http://www.nabble.com/Problem%3A-get-Client-IP-by-using-MessageContext-tp25531067p25531067.html
Sent from the Axis - User mailing list archive at Nabble.com.
Re: Problem: get Client IP by using MessageContext
Posted by Prabath Siriwardena <pr...@wso2.com>.
import org.apache.axis2.context.MessageContext;
IP = (String)MessageContext.getCurrentMessageContext().getProperty(MessageContext.*REMOTE_ADDR*);
Thanks & regards.
-Prabath
dishmily wrote:
> hello,
>
> my web service uses axis2. i want to get the Client (IP), which invokes my
> web service.
>
> by using:
>
>
> import org.apache.axis2.context.MessageContext;
>
> IP = (String)
> MessageContext.getCurrentMessageContext().getProperty("REMOTE_ADDR");
>
>
>
> i got the result: IP= 0:0:0:0:0:0:0:1
>
> what i wanted was that the result should be IP=127.0.0.1
>
> can anyone tell me how can i get the right result?
>
>
>
>
>
Re: Problem: get Client IP by using MessageContext
Posted by Prabath Siriwardena <pr...@wso2.com>.
import org.apache.axis2.context.MessageContext;
IP =
(String)MessageContext.getCurrentMessageContext().getProperty(MessageContext.REMOTE_ADDR);
Thanks & regards.
-Prabath
dishmily wrote:
> hello,
>
> my web service uses axis2. i want to get the Client (IP), which invokes my
> web service.
>
> by using:
>
>
> import org.apache.axis2.context.MessageContext;
>
> IP = (String)
> MessageContext.getCurrentMessageContext().getProperty("REMOTE_ADDR");
>
>
>
> i got the result: IP= 0:0:0:0:0:0:0:1
>
> what i wanted was that the result should be IP=127.0.0.1
>
> can anyone tell me how can i get the right result?
>
>
>
>
>