Decode MTOM Message Assertion

The Decode MTOM Message assertion is used to process MTOM-optimized messages and change them to regular SOAP messages. MTOM-optimized messages are based on the Message Transmission Optimization Mechanism (MTOM) specification.
gateway90
The
Decode MTOM Message
assertion is used to process MTOM-optimized messages and change them to regular SOAP messages. MTOM-optimized messages are 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 Select a Target Message.
The target message in this assertion is the message that is being decoded. In the assertion properties, this is the "Source Message". The "Target Message" in the properties is simply the destination to hold the decoded message.
MIME Multipart Messages
A SOAP service normally does not permit MIME multipart messages unless it is explicitly specified in the service's WSDL document or the policy contains an assertion that processes MIME multipart. Adding a Decode MTOM Message assertion that targets a request message in a policy will mean that the service(s) for that policy will permit MIME multipart messages.
MTOM Messages and WS-Security
By default, the Gateway will automatically decode MTOM-encoded messages if the message contains a WS-Security header that will be processed by the Gateway. The decoder will remove the packaging, leaving a regular SOAP message for WS-Security processing. The decoded MTOM message must be smaller than the permitted size for the XML part of a message.
For more information on the cluster properties involved, refer to the following properties in Gateway Cluster Properties:
mtom.decodeSecuredMessages
io.xmlPartMaxBytes
Attachments to an decoded MTOM message will be approximately 1/3 larger after decoding due to its Base64-encoding. This may cause the overall message size to exceed the limit specified by the
io.xmlPartMaxBytes
cluster property.
Using the Assertion
  1. 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.
  2. Right-click
    <target>:
    Decode MTOM Message
    in the policy window and select
    MTOM Decode Properties
    or double-click the assertion in the policy window. The assertion properties are displayed.
  3. Configure the properties as follows: 
    Setting
    Description
    Input/Output
    Source Message
    Specify which message should be decoded: 
    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 Message
    Specify the output message to hold the results of the decoding. 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 Variable
    If 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.
    Decode Settings
    Require encoded
    Select this check box to require that the source message be MTOM-encoded, otherwise the assertion will fail.
    Clear this check box to not fail the assertion if the source message is not MTOM-encoded.
    Remove packaging
    Select this check box to turn the message into a regular SOAP format.
    Clear this check box to place any attachment into the message but leave the message in MTOM format.
    This option is useful if you want to route a message in MTOM format but want to (for example) perform an XSL transformation or XML Schema validation on the message (including the attachment data).
    When a message is decoded, the XML message size is restricted by the
    io.xmlPartMaxBytes
    cluster property. If the message is too large to be converted, then the assertion will fail.
  4. Click [
    OK
    ] when done.