WSDL Binding for SOAP 1.2.

Overview

There are three key differences from the SOAP 1.1 binding:

·        A new namespace: http://schemas.xmlsoap.org/wsdl/soap12/

·        The encodingStyle attribute is now a single URI, instead of a list of URIs

·        There is a new attribute: soapActionRequired, which is used to indicated that the server needs the SOAPAction value.

Example

<?xml version="1.0" encoding="utf-8"?>

<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/encodedTypes" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">

  <types>

    <s:schema targetNamespace="http://tempuri.org/encodedTypes">

      <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />

      <s:import namespace="http://schemas.xmlsoap.org/wsdl/" />

      <s:complexType name="ArrayOfTest">

        <s:complexContent mixed="false">

          <s:restriction base="soapenc:Array">

            <s:attribute d7p1:arrayType="s0:Test[]" ref="soapenc:arrayType" xmlns:d7p1="http://schemas.xmlsoap.org/wsdl/" />

          </s:restriction>

        </s:complexContent>

      </s:complexType>

      <s:complexType name="Test">

        <s:sequence>

          <s:element minOccurs="1" maxOccurs="1" name="S" type="s:string" />

        </s:sequence>

      </s:complexType>

    </s:schema>

  </types>

  <message name="SayHelloWorldSoapIn" />

  <message name="SayHelloWorldSoapOut">

    <part name="SayHelloWorldResult" type="s0:ArrayOfTest" />

  </message>

  <portType name="HelloWorldSoap">

    <operation name="SayHelloWorld">

      <input message="tns:SayHelloWorldSoapIn" />

      <output message="tns:SayHelloWorldSoapOut" />

    </operation>

  </portType>

  <binding name="HelloWorldSoap" type="tns:HelloWorldSoap">

    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />

    <operation name="SayHelloWorld">

      <soap:operation soapAction="http://tempuri.org/SayHelloWorld" style="rpc" />

      <input>

        <soap:body use="encoded" namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />

      </input>

      <output>

        <soap:body use="encoded" namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />

      </output>

    </operation>

  </binding>

  <binding name="HelloWorldSoap12" type="tns:HelloWorldSoap">

    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />

    <operation name="SayHelloWorld">

      <soap12:operation soapAction="http://tempuri.org/SayHelloWorld" soapActionRequired="true" style="rpc" />

      <input>

        <soap12:body use="encoded" namespace="http://tempuri.org/" encodingStyle="http://www.w3.org/2001/12/soap-encoding" />

      </input>

      <output>

        <soap12:body use="encoded" namespace="http://tempuri.org/" encodingStyle="http://www.w3.org/2001/12/soap-encoding" />

      </output>

    </operation>

  </binding>

  <service name="HelloWorld">

    <port name="HelloWorldSoap" binding="tns:HelloWorldSoap">

      <soap:address location="http://localhost/bugs/soap12/helloworld.asmx" />

    </port>

    <port name="HelloWorldSoap12" binding="tns:HelloWorldSoap12">

      <soap12:address location="http://localhost/bugs/soap12/helloworld.asmx" />

    </port>

  </service>

</definitions>

Schema

This binding’s schema looks like this:

<schema xmlns="http://www.w3.org/2001/XMLSchema"

        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/"

            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

        targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/"

            xmlns:soap-env = "http://schemas.xmlsoap.org/soap/envelope/">

 

   <import namespace = "http://schemas.xmlsoap.org/wsdl/"/>

 

   <element name="binding" type="soap:tBinding"/>

   <complexType name="tBinding">

            <complexContent>

            <extension base="wsdl:tExtensibilityElement">

                        <sequence/>

                        <attribute name="transport" type="anyURI" use="optional"/>

                        <attribute name="style" type="soap:tStyleChoice" use="optional"/>

            </extension>

            </complexContent>

   </complexType>

 

   <simpleType name="tStyleChoice">

      <restriction base="string">

            <enumeration value="rpc"/>

            <enumeration value="document"/>

      </restriction>

   </simpleType>

   <element name="operation" type="soap:tOperation"/>

   <complexType name="tOperation">

            <complexContent>

            <extension base="wsdl:tExtensibilityElement">

                        <sequence/>

                        <attribute name="soapAction" type="anyURI" use="optional"/>

                        <attribute name=”soapActionRequired” type=”Boolean” use=”optional”/>

                        <attribute name="style" type="soap:tStyleChoice" use="optional"/>

            </extension>

            </complexContent>

   </complexType>

 

   <element name="body" type="soap:tBody"/>

   <attributeGroup name="tBodyAttributes">

               <attribute name="encodingStyle" type="anyURI" use="optional"/>         

               <attribute name="use" type="soap:useChoice" use="optional"/>

               <attribute name="namespace" type="anyURI" use="optional"/>

   </attributeGroup>

   <complexType name="tBody">

            <complexContent>

            <extension base="wsdl:tExtensibilityElement">

                        <sequence/>

                        <attribute name="parts" type="NMTOKENS" use="optional"/>

                        <attributeGroup ref = "soap:tBodyAttributes"/>

            </extension>

            </complexContent>

   </complexType>

   <simpleType name="useChoice">

      <restriction base="string">

               <enumeration value="literal"/>

               <enumeration value="encoded"/>

      </restriction>

   </simpleType>

   <element name="fault" type="soap:tFault"/>

   <complexType name="tFault">

            <complexContent>

            <restriction base="soap:tBody">

                        <sequence/>

                        <attribute ref = "wsdl:required" use="optional"/>

                        <attribute name="parts" type="NMTOKENS" use="prohibited"/>

                        <attributeGroup ref = "soap:tBodyAttributes"/>

            </restriction>

            </complexContent> 

  </complexType>

  <element name="header" type="soap:tHeader"/>

   <complexType name="tHeader">           

            <complexContent>

            <extension base="wsdl:tExtensibilityElement">

                  <sequence>

              <element ref="soap:headerfault"/>

                  </sequence>

                  <attribute name="message" type="QName" use="required"/>

      <attribute name="parts" type="NMTOKENS" use="required"/>

                  <attribute name="use" type="soap:useChoice" use="required"/>

                  <attribute name="encodingStyle" type="anyURI" use="optional"/>

                  <attribute name="namespace" type="anyURI" use="optional"/>     

            </extension>

            </complexContent>

   </complexType>

 

   <element name="headerfault" type="soap:tHeaderFault"/>

   <complexType name="tHeaderFault">           

      <attribute name="message" type="QName" use="required"/>

      <attribute name="parts" type="NMTOKENS" use="required"/>

      <attribute name="use" type="soap:useChoice" use="required"/>

      <attribute name="encodingStyle" type="anyURI" use="optional"/>

      <attribute name="namespace" type="anyURI" use="optional"/>     

   </complexType>

 

   <element name="address" type="soap:tAddress"/>

   <complexType name="tAddress">

            <complexContent>

            <extension base="wsdl:tExtensibilityElement">

                  <sequence/>

                  <attribute name="location" type="anyURI" use="required"/>

            </extension>

            </complexContent>

   </complexType>

</schema>