How to implement/modify SOAP with Attachments/MTOM in FSW
Issue
- The quickstart for SOAP with Attachments (SwA) puts the attachment reference directly in the body. In the
soap-attachment
quickstartSoapAttachmentClient
receives the following SOAP response from the SwitchYard endpoint:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"/>
<soap:Body>
<ns2:echoImageResponse xmlns:ns2="urn:switchyard-quickstart:soap-attachment:1.0">cid:external-switchyard.png</ns2:echoImageResponse>
</soap:Body>
</soap:Envelope>
- I would be very happy if you can provide a working example of the quickstart that responds with:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"/>
<soap:Body>
<ns2:echoImageResponse xmlns:ns2="urn:switchyard-quickstart:soap-attachment:1.0">
<attachments>
<attachmentName>external-switchyard.png</attachmentName>
<attachmentContent>cid:external-switchyard.png</attachmentContent>
</attachments>
</ns2:echoImageResponse>
</soap:Body>
</soap:Envelope>
- Can you edit it so it also returns the attachment name in the body? I can then try to update our code based on the example.
- We also want to use JAX-WS and MTOM&XOP. In our non-SwitchYard interfaces MTOM has worked without much effort and the SOAP content looks something like:
<attachments>
<attachment>
<fileName>order_000000000000000.csv</fileName>
<attachmentData>
<xop:Include href='cid:attachmentData-e992f924-9876-44bd-a245-bcd19e9506eb@ws.jboss.org' xmlns:xop='http://www.w3.org/2004/08/xop/include'/>
</attachmentData>
</attachment>
</attachments>
- But if trying it like in the
soap-attachment
quickstart, it looks like this:
<attachments>
<attachmentName>order_000000000000000.csv</attachmentName>
<attachmentContent>cid:order_000000000000000.csv</attachmentContent>
</attachments>
- How do we get that behavior with SwitchYard/Camel?
Environment
- Red Hat JBoss Fuse Service Works (FSW)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.