This document describes how to receive and send MIME attachments when working with SOAP-based web services.
It is a common scenario to transmit attachments with SOAP messages. Boomi allows you to achieve this with the Web Services Server and Web Service SOAP Client connector. Let's familiarize ourselves with the general flow of the process for receiving and sending SOAP attachments:
For additional information, see the User Guide: Web services with multipart SOAP attachments.
The attachment cache field in the Web Services Server operation and in the Web Services SOAP Client operation are used for storing/retrieving the attachment. You need to create a cache with a single index and a document property key WSS_ROOT_DOCUMENT_ID as shown below.
Note: the Profile Type set is "None".
A good example of receiving an attachment would be a candidate applying for a job, where he fills his details and uploads his resume on a portal. On submitting this form, a SOAP request is sent to a Boomi web service, where the resume is retrieved and used later in an encoded format.
Here's how the process could be configured to receive a MIME type of attachment:
The web services server operation:
The cache configuration in the process. The key value is going to be the DDP WSS_ROOT_DOCUMENT_ID that is automatically assigned. The key name will be the same name as the DDP used to retrieve the attachments, so that's why the parameter value looks like that.
In branch 1, the retrieve from cache retrieves the attachment document, which is then base64 encoded and stored in a process property. Branch 2 uses the incoming data as well as the encoded data of the PDF resume and returns the response.
Note: This example assumes a single attachment is received on the request and therefore can store the attachment data in a Process Property.
For testing purpose, we will be using SOAP UI to send the candidate information and the resume. Import the WSDL which contains the deployed WSS process details. Remember to set Enable MTOM as true in custom properties of your SOAP UI project to send the attachment as a MIME.
The candidate data along with a Base64 encoded format of resume is present in the response.
Here's an example of the raw SOAP request that will work with the SOAP attachment retrieval:
--uuid:736d19fd-646c-40b5-afb3-640a2738de35
Content-Id: <rootpart*736d19fd-646c-40b5-afb3-640a2738de35@example.jaxws.sun.com>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary
<?xml version='1.0' encoding='UTF-8'?><ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"><ns1:Body>
<ns2:testget xmlns:ns2="http://www.boomi.com/connector/wss">
<element>
<test>123</test>
</element>
</ns2:testget>
</ns1:Body></ns1:Envelope>
--uuid:736d19fd-646c-40b5-afb3-640a2738de35
Content-Id: <testpdf>
Content-Type: application/binary; name="testpdf"
Content-Transfer-Encoding: binary
<<PDF_data>>
--uuid:736d19fd-646c-40b5-afb3-640a2738de35--
The above is a multipart request. Retrieving the attachment will not work if you put the attachment data into an element in the SOAP body. You can use the element like you normally would, but there would be no attachments. For example, this would not produce any attachments and the listener process would not pull anything from the cache:
<?xml version='1.0' encoding='UTF-8'?><ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"><ns1:Body>
<ns2:testget xmlns:ns2="http://www.boomi.com/connector/wss">
<element>
<pdf><<PDF_Data>></pdf>
</element>
</ns2:testget>
</ns1:Body></ns1:Envelope>
Let's say you want to send an images of the product which are a part of tags in XML. The images are currently in base64 encoded format in the associated tags. While sending the product details and image to web server, we need to extract the images and send them to the web service as MIME SOAP Attachment.
The overall process:
The SOAP Operation with the Attachment Cache:
The DDP WSS_ROOT_DOCUMENT_ID has been configured with some static value in the beginning of the process. It can be any value if it is one document or you can set some profile value (or unique value) if you have multiple.
Note: the DDP WSS_ROOT_DOCUMENT_ID has to be defined before the branch so it can flow into the second branch and be used to pull the corresponding attachment in the doc cache. If you put it in the first branch only, the next branches will not be able to pull from the cache correctly since DDP's are not passed into different branches.
The DDP WSS_ATTACHMENT_CONTENT_ID determines the content ID and Content-Type name to be used in the SOAP request as show below in the headers:
--uuid:736d19fd-646c-40b5-afb3-640a2738de35 Content-Id: <123> Content-Type: application/binary; name="123" Content-Transfer-Encoding: binary <<PDF_Data>> --uuid:736d19fd-646c-40b5-afb3-640a2738de35--If you need to set those, you can do it through that DDP. This is optional, otherwise the process will choose a random content ID.
Currently you cannot: