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