Thank you Claus.

I recently found out, why we didn't use the following code:

     CxfEndpoint endpoint = (CxfEndpoint) 
camelContext.getEndpoint("cxf://http://remotehost/ws/service";);

It happens that one of the soap service urls has query string like in the 
following example:

     CxfEndpoint endpoint = (CxfEndpoint) 
camelContext.getEndpoint("cxf://http://remotehost/ws/service?stage=INT&tenant=MyCompany";);

I think Camel does not support this because it also uses query parameters for 
configuration.

Is there any possiblity to encode the service url?

With kind recards
Bert Speckels



i.A. Bert Speckels
BU Software Factory
Smart Software Solutions



BTC Business Technology Consulting AG
Escherweg 3
26121 Oldenburg
Tel:      +49 441 3612-2294
Mobil:   +49 174 3436354
Fax:     +49 441 3612-3999
E-Mail:  bert.speck...@btc-ag.com
Web:     http://www.btc-ag.com/



Rechtliche Hinweise:
http://www.btc-ag.com/impressum.htm
Handelsregister: Amtsgericht Oldenburg HRB 4717
Aufsichtsratsvorsitzender: Wolfgang Mücher
Vorstand: Dr. Jörg Ritter (Vorstandsvorsitzender), Percy Hamer













Von: Claus Ibsen <claus.ib...@gmail.com>
Gesendet: Dienstag, 13. Juni 2023 18:39
An: users@camel.apache.org <users@camel.apache.org>
Betreff: Re: interceptSendToEndpoint broken when setting address of CxfEndpoint

Hi

camel-cxf is a very old component. Yeah its not a good idea what it does,
and not sure if its really necessary.
You can try with git blame and see if you can find out some JIRA tickets or
some reason behind.

On Tue, Jun 13, 2023 at 12:08 PM Speckels, Bert <bert.speck...@btc-ag.com>
wrote:

> Hello everyone.
>
> We have currently a problem with intercepting our cxf endpoint (sending):
>
> interceptSendToEndpoint("cxf*")
>         .to("bean:mockSoapSendingInterceptor?method=mock");
>
> ---
>
> But I found the reason why intercepting does not work.
> We use java code to configure our CxfEndpoint:
>
> CxfEndpoint endpoint = (CxfEndpoint)
> camelContext.getEndpoint("cxf://OUR_ENDPOINT");
> endpoint.setAddress("http://remotehost/ws/service";);
> ...
>
> The problem is that setAddress(..) in CxfEndpoint not only set the target
> address but also replaces the endpoint uri.
> So the interceptor does not match because the endpoint uri doesn't start
> with "cxf" anymore but with "http".
>
> Here is the code from CXF:
>
> public void setAddress(String address) {
>
> super.setEndpointUri(UnsafeUriCharactersEncoder.encodeHttpURI(address));
>     this.address = address;
> }
>
> Is this really a good idea to replace the endpoint uri starting with
> "cxf:" with the target url of the soap endpoint?
> ---
>
> We had some good reasons to use "setAdress" instead or passing the endpoit
> uri directly like in the following example:
>
> CxfEndpoint endpoint = (CxfEndpoint) camelContext.getEndpoint("cxf://
> http://remotehost/ws/service";);
>
> I will try to figure out why this was not possible for us.
> But in the meantime: Maybe you have some other hints for me?!
>
> With kind regards
> Bert Speckels



--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to