SMO attachments
attachments element
for each attachment associated with a SOAP message.
Introduction
The SMO attachments elements
let you send and receive SOAP messages that have attachments of various
types.
You might want to send SOAP messages with attachments and let the attachments pass through the mediation flow unchanged, or you might want to create new attachments, perhaps from information in the message or from an external source.
Details
A SOAP/HTTP
message with attachments consists of a MIME multipart message
in which the SOAP body is the first part and the attachments are subsequent
parts (as defined in the SOAP
Messages with Attachments specification
and in the SOAP
Message Transmission Optimization Mechanism (MTOM) specification
).
attachments element
in the SMO. The way an attachment is represented in the SMO depends
upon whether the attachment is referenced or unreferenced. - Referenced attachments, which are defined in a WSDL port type
as parts within an input or output message and which have a binary
type, do not have their data stored in the SMO; instead, the path
to the message body element that holds the data is contained in the
bodyPathelement. - Unreferenced attachments, which are not defined in a WSDL port
type, have their data placed in the
dataelement in the SMO and have nobodyPathelement.
attachments element contains the following
information:- A
contentIDelementThe
contentIDelement contains the value of the Content-ID header of the MIME part and uniquely identifies the attachment in the message. - A
contentTypeelementThe
contentTypeelement contains the value of the Content-Type header of the MIME part and defines the type of data held by the attachment (for example,text/xmlorimage/gif). - A
bodyPathelement (used for referenced attachments only)The
bodyPathelement contains the path to the message body element where a referenced attachment is held.Note that MTOM can support attachment elements within nested structures meaning that thebodyPathfor MTOM attachments are thexpathlocation for the element where the MTOM attachment is held. The computing logic forbodyPathis strictly following the schema to generate thexpathlocation as shown in the examples below:- For a non-array type (
maxOccursis 1): /sendImage/input/imageData - For an array type (
maxOccurs> 1): /sendImage/input/imageData[1]
- For a non-array type (
- A
dataelement (used for unreferenced attachments only)The
dataelement contains the attachment data for unreferenced attachments.
- Web service binding: SOAP 1.1/HTTP using JAX-WS
- Web service binding: SOAP 1.2/HTTP using JAX-WS
- SCA binding
attachments element
to the userContext object. XML representation of SMO,the Mapping mediation primitive transforms messages using an XSLT 1.0 transformation or XSLT 2.0 transformation. The transformation operates on an XML serialization of the SMO. The Mapping mediation primitive allows the root of the serialization to be specified, and the root element of the XML document reflects this root.
- If you use
/body
as the root of the XML map, all attachments are propagated across the map by default. - If you use
/
as the root of the map, you can control the propagation of attachments.
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15