Outbound MTOM message processing for pipelines that do not support Java
When a pipeline that does not support Java is configured to send outbound MTOM messages, the web service and pipeline properties are checked to determine how the message should be processed and sent.
These properties are stored in two containers, DFHWS-MTOM-OUT and DFHWS-XOP-OUT. In a requester mode pipeline, these containers are created by CICS when the application issues the EXEC CICS INVOKE WEBSERVICE command. In a provider mode pipeline, the DFHWS-MTOM-OUT container is already initialized with the options that were determined when the inbound message was received.
If the outbound message can be processed in direct mode, the optimization of the message takes place immediately. If the outbound message has to be processed in compatibility mode, the optimization takes place at the very end of the pipeline processing.
If you have not deployed your web service provider or requester application using the CICS web services assistant, or if you have web service validation enabled or Web Services Security enabled in your pipeline, the outbound message is processed in compatibility mode.
Direct mode
In direct mode, the following processing takes place:
- An XOP document is constructed from the application's data structure
in container DFHWS-DATA. Any binary fields that are equal to or larger
in size than 1500 bytes are identified, and the binary data and MIME
headers describing the binary attachment are put in separate containers.
If the binary data is already in a container, that container is used
directly as the attachment. A <xop:Include> element
is then inserted in the XML in place of the usual base64-encoded binary
data using a generated Content-ID. For example:
<xop:Include href="cid:generated-content-ID-value" xmlns:xop="http://www.w3.org/2004/08/xop/include"> - All of the containers are added to the attachment list in the DFHWS-XOP-OUT container.
- When the SOAP handler has processed DFHWS-DATA, the XOP document and SOAP envelope are stored in the DFHREQUEST or DFHRESPONSE container and processed through the pipeline.
- When the last message handler has finished, the MTOM handler packages the XOP document and binary attachments into a MIME Multipart/Related message and sends it to the web service requester or provider. The DFHWS-XOP-OUT container and any associated containers are then discarded.
Compatibility mode
If the pipeline is not capable of handling the XOP document directly, then the following processing takes place:
- The SOAP body is constructed in DFHWS-DATA from the application data structure and processed in the pipeline as normal.
- When the final handler has finished processing the message, the MTOM handler checks the options in the DFHWS-MTOM-OUT container to determine whether MTOM should be used, optionally taking into account whether any binary attachments are present. If the MTOM handler determines that MTOM is not required, no XOP processing takes place and a SOAP message is sent by CICS as normal.
- If the MTOM handler determines that the outbound message should be sent in MTOM format, the XOP processing scans the message for eligible fields to split the data out into binary attachments. For a field to be eligible, it must have the MIME contentType attribute specified on the element and the associated binary value must consist of valid base64Binary data in canonical form. The size of the data must be greater than 1500 bytes. The XOP processing creates the binary attachments and attachment list, and then replaces the fields with <xop:Include> elements.
- The MTOM handler packages the XOP document and binary attachments as a MIME Multipart/Related message and CICS sends it to the web service requester or provider.