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 Kiss Attila <at...@axelero.hu> on 2003/10/18 17:30:32 UTC

Client IP address

Hi

I am using axis with Jbuider I wrote a java bean and i exported as web
service . the problem is that i dont know how can i get the client's IP
address.

thanks for your help

Attila


Re: Client IP address

Posted by Kiss Attila <at...@axelero.hu>.
Thank you it was a big help :) !


----- Original Message ----- 
From: "Vitali W. Danilow" <bo...@mysterion.de>
To: "Kiss Attila" <ax...@ws.apache.org>
Sent: Sunday, October 19, 2003 1:06 AM
Subject: Re: Client IP address


> here we go...
>
> private String getClientIP() {
>         HttpServletRequest srv = (HttpServletRequest)
MessageContext.getCurrentContext().getProperty(HTTPConstants.
>             MC_HTTP_SERVLETREQUEST);
>
>         if (srv != null) {
>             return srv.getRemoteAddr();
>         }
>         else {
>             return null;
>         }
>     }
>
> cu boblgum
>
>
>


Re: Client IP address

Posted by "Vitali W. Danilow" <bo...@mysterion.de>.
here we go...

private String getClientIP() {
        HttpServletRequest srv = (HttpServletRequest) MessageContext.getCurrentContext().getProperty(HTTPConstants.
            MC_HTTP_SERVLETREQUEST);

        if (srv != null) {
            return srv.getRemoteAddr();
        }
        else {
            return null;
        }
    }

cu boblgum


Re: Client IP address

Posted by Jose M Selman <js...@bee.cl>.
I don't know what exactly, but i do know that is has to be in the
MessageContext. You can get that from within the service with

    mc = org.apache.axis.MessageContext.getCurrentContext().

Then you can get properties from it, like the ones defined in
org.apache.axis.transport.http.HTTPConstants, using the getProperty method
of the MessageContext.

Hope that gives you  a start... I'm facing the same issue so if someone
knows the answer please post it.

Jose Selman

----- Original Message -----
From: "Kiss Attila" <at...@axelero.hu>
To: <ax...@ws.apache.org>
Sent: Saturday, October 18, 2003 12:30 PM
Subject: Client IP address


> Hi
>
> I am using axis with Jbuider I wrote a java bean and i exported as web
> service . the problem is that i dont know how can i get the client's IP
> address.
>
> thanks for your help
>
> Attila
>
>