Messages With Attachments
SOAP messages can have message parts that contain attachments. For a message part to contain an attachment, specify the Special Type in the Type field of the Part Details section of the Message resource when creating a WSDL file configuration. For more information about creating WSDL files, see WSDL Palette.
Depending on the SOAP version being used, messages with attachments can conform to one of the following styles:
-
Messages with Attachments (SwA) - available with SOAP version 1.1 and 1.2.
-
Message Transmission Optimization Mechanism (MTOM) - available with SOAP version 1.1 and 1.2.
Messages with Attachments (SwA)
SOAP clients that send messages with attachments in the SwA style must conform to the SOAP Messages with Attachments specification (http://www.w3.org/TR/SOAP-attachments).
The input or output schema element for a message part that contains an attachment holds the content ID of the attachment instead of holding the actual attachment data. The actual data for attachments is always contained within the mimeEnvelopeElement of the output schema for this resource. This element contains a repeating element named mimePart that holds the list of attachments in the SOAP message. The attachment list can be correlated to the message parts containing the attachments by using the content-id mimeHeader element.
Message Transmission Optimization Mechanism (MTOM)
Message Transmission Optimization Mechanism (MTOM) provides another way of sending binary content or attachment processing by serializing SOAP messages with attachments. Optimization is only available for element content that is in a canonical lexical representation of xs:base64Binary
data type. MTOM conforms to the specification http://www.w3.org/TR/soap12-mtom.
Any element of type xs:base64Binary
(or an extension of xs:base64Binary
) in the SOAP response message is treated as an MTOM attachment and appears as a separate MIME part on the wire. The SOAP message have an XOP include reference to the attachment. Any XOP include reference in the SOAP message get replaced by the corresponding attachment’s content encoded in Base64. Any MIME attachment that is not referenced from the SOAP Message using XOP include reference get ignored by the MTOM Processing layer. Note that the attachment is a part of the SOAP Infoset. For more information about MTOM and Write to File, see TIBCO ActiveMatrix BusinessWorks™ Process Design.
Overriding the Content Type MimeHeader
Currently, the ActiveMatrix BusinessWorks activities hard codes the Content Type mimeHeader with the value "application/octet-stream" while sending MTOM messages.
Now you can over ride the value of contentType
mime header if the Content Type attribute (with namespace http://www.w3.org/2005/05/xmlmime) has been declared corresponding to a binary element in the message schema while sending MTOM messages
To enable this feature, add the Content Type attribute as explained below:
<xs:element name = "picture" xmlns:ns1 = "http://www.w3.org/2005/05/xmlmime">
<xs:complexType>
<xs:simpleContent>
<xs:extension base = "xs:base64Binary">
<xs:attribute ref = "ns1:contentType"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
This feature is applicable for all activities in the SOAP and Service Palette that send outbound MTOM messages.