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

Reply via email to