Hello all,
I'm using Camel 1.5 and CXF 2.1.3 to proxy some existing services to
enable applications to call us using SOAP over HTTP - essentially we are
writing a lightweight integration layer.
We've been thrown a requirement in that we need to proxy a service that
needs a SOAP attachment (using MTOM but thats arbitrary in this
context). So, I set up the CXF proxy to enable MTOM, set up some XSLT
and thought that would be about all.
However, Camel itself doesn't seem to acknowledge SOAP attachments and
does not save them in the org.apache.camel.Message as it passes through
the pipeline. For example, the first time we do an XSLT transformation,
the XSLT component gets the javax.xml.soap.SOAPMessage (as passed
through from CXF), gets the soap body and transforms successfully, but
then it blows away the SOAPMessage (including the MIME headers and
attachments) and replaces it with the String transformation result.
Perhaps there is something I'm missing, but does Camel not handle SOAP
attachments very well? If it can, are there any tutorials or examples
anyone can share?
The workaround I have is to save the original SOAPMessage in a
ThreadLocal, let Camel go and transform it to a String (or whatever) in
the pipeline, and then merge the transformed XML back into the original
SOAPMessage before sending it on it's way. That's OK for now but it
does feel a bit hackish.
Thanks,
Jason
- Camel, CXF and handling Soap Attachments Jason Royals
-