Ok, I notice now that my solution only works when adding streamCache="true" to my (Spring xml configured) route. That makes sense in order to be able to manipulate the message, but I still don't understand why all these pieces seem to work, nor if this is the correct way to enrich a soap message which is proxied by a CXF endpoint.
On Fri, Feb 1, 2013 at 4:51 PM, Nico Mommaerts <nico.mommae...@gmail.com> wrote: > Hey, > > I'm having a hard time understanding the dataformats in cxf > (http://camel.apache.org/cxf.html#CXF-Thedescriptionsofthedataformats) > and what they are for. > > The use case I'm implementing is like the cxf proxy example > (http://camel.apache.org/cxf-proxy-example.html) except that I want to > add some Soap Headers to the message that is sent to the real > webservice. > I succeeded in doing so by following the example, and getting the > Header element from the Document passed to my enrichBean. However, I > don't understand why this works: > > * How does Camel know to call which method in the enrichBean and why > does it know it has to pass a Document? Couldn't find anything on the > website about this. > * It says here > http://camel.apache.org/cxf.html#CXF-SOAPheadersarenotavailableinMESSAGEmode > that SOAP headers are not available in the MESSAGE dataformat, how > come I can access them and change them before sending to the real > webservice? > * If I try any other dataformat then MESSAGE, it doesn't work. I get a > 500, or just an empty SOAP response, or a NullpointerException. What > exactly does the dataformat apply to? The content of the exchange that > is being sent to the next component in my route? > * Is this the correct (best) way to add a soapheader? > > Thanks, > Nico