WS-MTOM Policy

Overview

Note that policy is required to enable ws-mtom module instances which are used to send a partner request only. MTOM modules are always enabled when receiving a message, i.e. by evaluating the media-type portion of the content-type string to see if it is "application/xop+xml". If MTOM was enabled when receiving a request for 'my' service, and the corresponding response has optimizable content, the response, if any, will also be optimized. For more information regarding how policy is used, e.g. how and where it may be attached and the difference between public and private policy, please see the user guide.

Note that the axiom message is currently the only message type that is capable of manipulating binary content as a text node, i.e. your application would have to define runtime message instances of this type in-order to utilize this feature (in order to set and retrieve the binary data.)

Vocabulary

<!--
  
  (c) 2005-2006 International Business Machines Corporation and Microsoft Corporation.
  All rights reserved. Permission to copy and display the MTOM Serialization Policy Assertion
  Specification (the "Specification", which includes WSDL and schema documents), in any
  medium without fee or royalty is hereby granted, provided that you include the following
  on ALL copies of the Specification that you make: 

  1. A link or URL to the Specification at one of the Authors' websites. 
  2. The copyright notice as shown in the Specification. 

  International Business Machines Corporation and Microsoft Corporation (collectively, the
  "Authors") each agree to grant you a license, under royalty-free and otherwise reasonable,
  non-discriminatory terms and conditions, to their respective essential patent claims that
  they deem necessary to implement the Specification. 

  THE SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR
  WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE;
  THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
  IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
  TRADEMARKS OR OTHER RIGHTS. 

  THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR
  CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
  SPECIFICATION. 

  The name and trademarks of the Authors may NOT be used in any manner, including
  advertising or publicity pertaining to the Specification or its contents without
  specific, written prior permission. Title to copyright in the Specification will
  at all times remain with the Authors. 

  No other rights are granted by implication, estoppel or otherwise.
-->
<xs:schema
  targetNamespace="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"
  xmlns:tns="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"
  xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified"
  attributeFormDefault="unqualified" >

  <xs:import
    namespace="http://schemas.xmlsoap.org/ws/2004/09/policy"
    schemaLocation="http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd" />

  <xs:element 
    name="OptimizedMimeSerialization" 
    type="tns:OptimizedMimeSerializationType" />

  <xs:complexType name="OptimizedMimeSerializationType" >
    <xs:attribute ref="wsp:Optional" />
    <xs:anyAttribute namespace="##any" processContents="lax" />
  </xs:complexType>

</xs:schema>

Examples

Note that the type of policy used to constrain this feature module is an extension to the core EOA specification. The examples below use policy which complies with version 1.5 of the ws-policy specification.

Public Policy

Public policy is required to enable/constrain ws-mtom module(s) for a specific endpoint. The policy will either indicate that ws-mtom is supported or ws-mtom is required as demonstrated within the following example (note that the abstract component definitions have been elided for clarity).

WSDL Descriptions
<deployment xmlns="http://bluestemsoftware.org/specification/eoa/1.0/deployment">
  <components>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://com.mycompany/eoa/component/1.0" xmlns:tns="http://com.mycompany/eoa/component/1.0">
      <wsdl:binding name="myBinding" type="http://www.w3.org/ns/wsdl/soap" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.1" wsoap:protocol="http://www.w3.org/2006/01/soap11/bindings/HTTP" />
      <wsdl:service name="myService" interface="tns:myInterface">
        <wsdl:endpoint name="myEndpoint" binding="tns:myBinding" address="http://someuri">
          <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
            <wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" />
          </wsp:Policy>
        </wsdl:endpoint>
      </wsdl:service>
      <ext:engine xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="myEngine" application="tns:myApplication">
        <ext:actor role="http://some/role" service="tns:myService" />
      </ext:engine>
    </wsdl:description>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://com.mycompany/eoa/component/1.0" xmlns:tns="http://com.mycompany/eoa/component/1.0">
      <wsdl:binding name="partnerBinding" type="http://www.w3.org/ns/wsdl/soap" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.1" wsoap:protocol="http://www.w3.org/2006/01/soap11/bindings/HTTP" />
      <wsdl:service name="partnerService" interface="tns:myInterface">
        <wsdl:endpoint name="partnerEndpoint" binding="tns:partnerBinding" address="http://someuri">
          <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
            <wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true" />
          </wsp:Policy>
        </wsdl:endpoint>
      </wsdl:service>
      <ext:engine xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="partnerEngine" application="tns:myApplication">
        <ext:actor role="http://some/role" service="tns:partnerService" />
      </ext:engine>
    </wsdl:description>
  </components>
</deployment>

Within the descriptions above, "myEndpoint" indicates mtom is required, "partnerEndpoint" indicates mtom is supported.

Private Policy

Note that the following examples use the "default engine" provider to demonstrate private policy attachements. The structure employed by other providers should be similar.

Forcing Non-specific Policy to Require MTOM

If public policy defined on a partner endpoint is non specific regarding mtom requiredness, e.g. to force optimization on "partnerEndpoint" requires the following private policy:

<deployment xmlns="http://bluestemsoftware.org/specification/eoa/1.0/deployment">
  <providers>
    <engine xmlns="http://bluestemsoftware.org/specification/eoa/ext/engine/default/1.0" xmlns:tns="http://com.mycompany/eoa/component/1.0" name="tns:myEngine">
      <partners>
        <engineReference engineName="tns:myEngine">
          <serviceReference serviceName="tns:myService" />
        </engineReference>
        <engineReference engineName="tns:partnerEngine">
          <serviceReference serviceName="tns:partnerService">
            <endpointReference endpointName="partnerEndpoint">
              <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
                <wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" />
              </wsp:Policy>
            </endpointReference>
          </serviceReference>
        </engineReference>
      </partners>
    </engine>
  </providers>
</deployment>