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>
As far as I am aware there is no such
CXF_MESSAGEdata format at all. There arePOJO(which is default),PAYLOADandMESSAGE. With theMESSAGEdata format you won’t be able to process anySOAP– this mode applies to noSOAPprocessing.In order to process
SOAPheaders you need to specify thePAYLOADdata format. Then you would be able to processSOAPheaders. 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: