axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Haensgen <P.Haens...@intershop.de>
Subject RE: I'm a service; What's my endpoint?
Date Thu, 15 Aug 2002 17:34:10 GMT

You could try something like this:

                HttpServletRequest request = (HttpServletRequest)
msgContext.getProperty(
                    HTTPConstants.MC_HTTP_SERVLETREQUEST);

And there you have methods like:
	request.getRequestURI();
	request.getPathInfo();
	request.getPathTranslated();
etc.

hth,
Peter
		

> -----Original Message-----
> From: Adam Kurland [mailto:Adam@biospace.com]
> Sent: 15 August 2002 19:23
> To: 'axis-user@xml.apache.org'
> Subject: I'm a service; What's my endpoint?
> 
> 
> I have a need for a web-service implementation class (jax-rpc 
> service class)
> to obtain its own serviceEndpoint URL.
> 
> I know that in Axis Beta 3, I can get to the ServletContext 
> which "houses"
> the class like this:
> 
> 	MessageContext msgContext = MessageContext.getCurrentContext();
> 	if (msgContext != null) {
> 	    ServletContext sc = 
> 		((HttpServlet)msgContext.getProperty
> 		 (HTTPConstants.MC_HTTP_SERVLET)).getServletContext();
> 	    
> 	    System.err.println("got servletContext");
> 	    if (sc != null) {
> 		System.err.println("server info=" + sc.getServerInfo());
> 
> But how would I get URL that the client used to get to the 
> this service,
> from within the service?, i.e. the axis service endpoint.
> Remember that the tail end of the endpoint is contained in a 
> wsdd file as
> the service name:
> <service name="statefulFRED" provider="java:RPC">
> and the first part of the endpoint is the URL to
> http://machaine-where-I-installed-axis:port/axis-webapp-name/services 
> 
> A Jax-rpc "way" would be nice, but I'd settle for a 
> axis-beta-3-sepcific
> way.
> 
> By the way, my current workaround is to have the client pass 
> the service
> endpoint to the service as the first parameter.  Sort of like calling
> someone and telling them their own phone number every time.
> 
> Thanks
> Adam
> 

Mime
View raw message