1
votes

I'm using Camel to proxy a webservice (I need to modify the soap header first). I'm using the CXF_MESSAGE dataformat as that allows me to easily change the soap header. Sending a soap message using soapui works fine, and I can see it arrives at the real webservice, however, the response is always an empty soap envelope? When I switch to the MESSAGE dataformat the response is correct (but then I can't change the SOAP headers).

What am I doing wrong? Why does the dataformat change the in/out behaviour?

<cxf:cxfEndpoint id="broker">
      ...
</cxf:cxfEndpoint>

<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
    <endpoint id="realWS" uri="http://localhost:8080/service?throwExceptionOnFailure=true" />

    <route>
        <from uri="cxf:bean:broker?dataFormat=CXF_MESSAGE" />
        <to ref="realWS" />
    </route>        
</camelContext>
1

1 Answers

2
votes

As far as I am aware there is no such CXF_MESSAGE data format at all. There are POJO (which is default), PAYLOAD and MESSAGE. With the MESSAGE data format you won't be able to process any SOAP - this mode applies to no SOAP processing.

In order to process SOAP headers you need to specify the PAYLOAD data format. Then you would be able to process SOAP headers. Check here how to do this. Note: In this link the routes are done via Java code. In order to do this via Spring you'll have to create your own Processor and then from URI forward your message to your custom processor, modify headers and send it back to the real endpoint.

See also: