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 "Peake, Chris" <Ch...@ca.com> on 2002/10/09 17:53:04 UTC

How to get hostname and port of service

Kinda of a crazy question but I don't seem to see the mechanism to do the following.
I am wanting to return the hostname and port from where my service is being called.

Yes, I know that the client must know this to make the call.
And that WSDL will show this.

But suppose a 'helloworld' service just wants to surface this information for some valid reason.
I cannot find a way to get my hands on the http:\\locahost:8080 information.
I've looked at the static methods:
Session s = org.apache.axis.MessageContext.getCurrentContext().getSession();
and
Message m = org.apache.axis.MessageContext.getCurrentContext().getCurrentMessage();

Still don't see the way to the info I need.
Basically, the hostname from request:  hostname
       and the  portnumber from request: port.

thanks for any help.


Chris