cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Change endpoint address of service
Date Tue, 29 May 2012 16:02:23 GMT

With CXF 2.5.x and newer, the WSDL GET stuff is an interceptor on the chain 
and will use contextual properties to determine the URL to stick in the 
WSDL.   Thus, you could add an Interceptor prior to the wsdl get stuff that 
would grab the HTTP request information, mangle it a bit, and set the 
properties back onto the message where the WSDL get interceptor would pick 
them up.  

Dan


On Friday, May 25, 2012 12:46:30 PM rouble wrote:
> We have versioned services that runs on:
>      https://example.com:8443/v2/foo
>      https://example.com:8443/v4/foo
>      https://example.com:8443/v7/foo
> 
> Every time there is a backwards in-compatible change we leave the old
> service in place, and create a new one. This supports older clients.
> If the changes are backwards compatible, we only bump up the number in
> the URL.
> 
> We also have a mediator service that runs on:
>      https://example.com:8443/foo
> 
> We want all generated clients to come in through the mediator so we
> can route them accordingly. So, I want to change the endpoint
> addresses in the WSDL of the versioned services so that they all have
> the endpoint address of the mediator service. This is necessary
> because if a version/URL is re-numbered (because it is backwards
> compatible), I can route the older clients to the newer service. So,
> in this example, I could route a v5 client to the service at the v7
> URL.
> 
> I have done some nifty spring EL like this right now, to set the
> publishedEndpointUrl:
>      <bean id="localhost" class="java.net.InetAddress"
> factory-method="getLocalHost" />
> 
>      <bean id="publishedWebServiceUrl" class="java.lang.String">
>          <constructor-arg value="#{'http://' + localhost.hostName +
> '/foo'}" /> </bean>
> 
>      <jaxws:endpoint
>         id="fooWS"
>         address="/v2/foo"
>         publishedEndpointUrl="#publishedWebServiceUrl"/>
> 
> But this does not get the port (in this case 8443), and it does not
> work if web service is behind a proxy.
> 
> Instead of trying to re-build the endpoint address from scratch I was
> wondering if there is a way to get the existing endpoint address at
> runtime, massage it a little bit, and reset it - or something to that
> effect.
> 
> tia,
> rouble
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message