You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by rouble <r....@gmail.com> on 2011/11/23 00:01:50 UTC

use local hostname in publishEndpointUrl

CXF Gurus,

I want to specify the url in the code first generated wsdl. I
understand that the way to do this is using publishEndpointUrl.

However, publishEndpointUrl hardcodes the entire url. Is there a way
to just specify just the ending stem of the url, and use the local
hostname for the beginning part?

I need this because, I have versioned webservices running at:
    http://example.com/v1/foo
    http://example.com/v2/foo
    http://example.com/v3/foo

And, I have a service routing/mediating service at:
    http://example.com/foo

This is similar to what is defined here:
http://cxf.apache.org/docs/service-routing.html

I want the urls in all the wsdls to all point to the
http://www.example.com/foo, this way all the soap clients will be
generated
to point to the routing service, and then let the routing service, to
route the requests appropriately.

tia,
rouble

Re: use local hostname in publishEndpointUrl

Posted by rouble <r....@gmail.com>.
Here is one way to do it using spring xml configuration:
http://stackoverflow.com/questions/8235045/concatenate-string-in-spring-xml-configuration

This should work on earlier versions of CXF.

Let me ask another (related) question:
How do I redirect a generic wsdl url:

    http://example.com/webapp/foo?wsdl

to the latest version of the service:

    http://example.com/webapp/v3/foo?wsdl

tia,
rouble

On Wed, Nov 23, 2011 at 10:54 AM, Daniel Kulp <dk...@apache.org> wrote:
>
> The only way I can think to do this is to write an interceptor that would live
> before the WSDLGetInterceptor (assuming CXF 2.5.0) that would calculate a new
> publishEndpointUrl as a string and set that on the message.   In 2.5.0, that
> property is a contextual property and over ridable via interceptors.
>
> Dan
>
>
> On Tuesday, November 22, 2011 6:01:50 PM rouble wrote:
>> CXF Gurus,
>>
>> I want to specify the url in the code first generated wsdl. I
>> understand that the way to do this is using publishEndpointUrl.
>>
>> However, publishEndpointUrl hardcodes the entire url. Is there a way
>> to just specify just the ending stem of the url, and use the local
>> hostname for the beginning part?
>>
>> I need this because, I have versioned webservices running at:
>>     http://example.com/v1/foo
>>     http://example.com/v2/foo
>>     http://example.com/v3/foo
>>
>> And, I have a service routing/mediating service at:
>>     http://example.com/foo
>>
>> This is similar to what is defined here:
>> http://cxf.apache.org/docs/service-routing.html
>>
>> I want the urls in all the wsdls to all point to the
>> http://www.example.com/foo, this way all the soap clients will be
>> generated
>> to point to the routing service, and then let the routing service, to
>> route the requests appropriately.
>>
>> tia,
>> rouble
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>

Re: use local hostname in publishEndpointUrl

Posted by Daniel Kulp <dk...@apache.org>.
The only way I can think to do this is to write an interceptor that would live 
before the WSDLGetInterceptor (assuming CXF 2.5.0) that would calculate a new 
publishEndpointUrl as a string and set that on the message.   In 2.5.0, that 
property is a contextual property and over ridable via interceptors.

Dan


On Tuesday, November 22, 2011 6:01:50 PM rouble wrote:
> CXF Gurus,
> 
> I want to specify the url in the code first generated wsdl. I
> understand that the way to do this is using publishEndpointUrl.
> 
> However, publishEndpointUrl hardcodes the entire url. Is there a way
> to just specify just the ending stem of the url, and use the local
> hostname for the beginning part?
> 
> I need this because, I have versioned webservices running at:
>     http://example.com/v1/foo
>     http://example.com/v2/foo
>     http://example.com/v3/foo
> 
> And, I have a service routing/mediating service at:
>     http://example.com/foo
> 
> This is similar to what is defined here:
> http://cxf.apache.org/docs/service-routing.html
> 
> I want the urls in all the wsdls to all point to the
> http://www.example.com/foo, this way all the soap clients will be
> generated
> to point to the routing service, and then let the routing service, to
> route the requests appropriately.
> 
> tia,
> rouble
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com