Oliver,

On Tuesday, June 21, 2011 7:51:43 PM Oliver Wulff wrote:
> I was thinking that it must be possible to figure this out at startup time.
> I remember that I read that there was some refactoring regarding the
> different http transports which would simplify the way to get this
> information.

No, Willem is right.   There isn't anything in the Servlet context or config 
that would allow you to get that information.    It's partially because a 
single servlet can be bound to multiple locations and different ports and 
such.    Thus, it's only during the invoke that you can determine how the 
client contacted the servlet.


Dan



> I think it's error prone to configure it in the spring config if everything
> is already configured in tomcat server.xml and the web app name (servlet
> context name).
>
> Thanks
> Oli
> 
> ________________________________________
> Von: Willem Jiang [[email protected]]
> Gesendet: Montag, 20. Juni 2011 12:03
> An: [email protected]
> Betreff: Re: Fully qualified endpoint address at startup time
> 
> It's hard to know what the exactly the services address is when you
> start the the endpoint in the servlet or osgi container.
> The address will be changed if your war or servlet configure is changed.
> 
> If you already know the physical address, you may consider to use
> publishedEndpointUrl property to set the address which will be used in
> the WSDL that is generate dynamically from CXF.
> 
> <jaxws:endpoint id="myEndpoint" address="MyServicePort"
> serviceClass="org.apache.hello_world_soap_http.GreeterImpl" >
>    <jaxws:properties>
>      <!-- Set the publishedEndpointUrl which could override the service
> address from generated WSDL as you want -->
>      <entry key="publishedEndpointUrl"
> value="http://www.simple.com/services/test"; />
>     </jaxws:properties>
> </jaxws:cxfEndpoint>
> 
> On 6/18/11 2:42 PM, Oliver Wulff wrote:
> > Hi there
> > 
> > Does there exist a way to figure out the fully qualified endpoint
> > address for an http based endpoint at startup time independent of the
> > underlying container (servlet, osgi, jetty)?
> > 
> > The following way works for an incoming request but I'm looking for a
> > way during startup:
> > 
> > HttpServletRequest req = (HttpServletRequest)msg.get("HTTP.REQUEST")
> > if (req != null) {
> > ... = req.getRequestUrl();
> > }
> > 
> > 
> > Thanks
> > Oli
> 
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>           http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to