axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Johnson <johns...@gmail.com>
Subject Re: obtain remote ip address from soap
Date Sat, 24 Sep 2005 13:30:28 GMT
A oneline fix as found in the FAQ

String remoteIP = msgContext.getStrProp(Constants.MC_REMOTE_ADDR);

..Chris

On 9/24/05, Soactive Inc <soactive@gmail.com> wrote:
> I think the following code may work for you.
>
>  ---
>
>      org.apache.axis.MessageContext context =
> org.apache.axis.MessageContext.getCurrentContext();
>              Message message = context.getRequestMessage();
>
>              HttpServletRequest servletRequest = (HttpServletRequest)
>
> context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
>
>              String clientAddress = servletRequest.getRemoteAddr();
>              String clientHostName = servletRequest.getRemoteHost();
>
>  ---
>
>  -Arun
>
> On 9/23/05, William Mok <wmok@memotrax.com> wrote:
> >
> > Hi,
> >
> > I am using the messaging style in axis, hence writing a method called=20
> >
> > process(SOAPEnvelpe req, SOAPEnvelope resp) can receive the soap message =
> > from the remote end.
> >
> > However, I would like to know how I can obtain the remote IP address, =
> > i.e. the soap message sender ip addr.
> > Thanks.
> >
> > William
> >
>

Mime
View raw message