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