Encode to MTOM Format Assertion
The Encode to MTOM Format assertion is used to create optimized messages. It will convert a regular SOAP message to an optimized MIME multipart/related serialization format based on the Message Transmission Optimization Mechanism (MTOM) specification.
gateway90
The
Encode to MTOM Format
assertion is used to create optimized messages. It will convert a regular SOAP message to an optimized MIME multipart/related serialization format based on the Message Transmission Optimization Mechanism (MTOM) specification.The target message for this assertion can be selected from within the assertion properties or by right-clicking the assertion in the policy window and choosing "Select Message Target". For more information on the latter, see Selecting a Target Message.
The target message in this assertion is the message that is being encoded. In the assertion properties, this is the "Source Message". The "Target Message" in the properties is simply the destination to hold the encoded message.
SOAP 1.2 is required for standard MTOM encoding. If a SOAP 1.1 message is encoded, it will result in a non-standard optimized message. MTOM encoding will not change the SOAP version.
Auditing MTOM Messages
When an MTOM-encoded message is audited, only the XML part is recorded. Any attachments are not included in the audited data.
Using the Assertion
- Do one of the following:
- To add the assertion to the Policy Development window, see Add an Assertion.
- To change the configuration of an existing assertion, proceed to step 2 below.
- Right-clickin the policy window and select<target>:Encode to MTOM FormatMTOM Encode Propertiesor double-click the assertion in the policy window. The assertion properties are displayed.
- Configure the properties as follows:SettingDescriptionInput/OutputSource MessageSpecify which message should be encoded:Request,Response, or a message context variable, if one has been defined by this point in the policy. Message variables will appear as"${variable_name}"in the drop-down list.The Source Message can also be changed by right-clicking the assertion in the policy window and choosing "Select Target Message". For more information, see Selecting a Target Message.Target MessageSpecify the output message to hold the results of the encoding. Choose from:
- Default:Place the result back into the source message.
- Request:Place the result into the request message.
- Response:Place the result into the request message.
- Message Variable:Place the result into the message context variable specified below.
Message VariableIf the Target Message is "Message Variable", enter the name of the message context variable here, in the format:${variable_name}. If the variable does not already exist, it will be created.Encode SettingsAlways encodeSelect this check box to always encode the message, even if no attachments will be created. This setting is the default.Clear this check box to skip encoding if no elements were found or if elements were found but were below the "Optimization threshold".Optimization thresholdOptionally enter a threshold size for encoding. The MTOM encoding will not occur if each individual selected element content is smaller than this thresholdand"Always encode" is not selected. When selected element content is larger than the threshold size, it will be optimized. When the threshold is not met, the element's content is not optimized.Optimization XPathsThis section lets you enter specific XPaths to select the elements containing content for optimization.- To add an XPath, click [Add]. See Selecting an XPath for more details.
- To modify an XPath on the list, select it and then click [Edit]. See Selecting an XPath for more details.
- To remove an XPath from the list, select it and then click [Remove].
Fail if element not foundSelect this check box to have the assertion fail if any of the optimization XPaths do not match any elements.Clear this check box to not fail the assertion if no elements are found. - Click [OK] when done.