Multiplart Style Example - Reservation

This section provides a tutorial example on writing a WSDL 2.0 example that uses SOAP 1.2 over HTTP with Multipart as the message style.

My next WSDL 20 example was converted from the WSDL 1.1 version:

In this WSDL example, I want to send a SOAP request to reserve a list of books in a library. And I expect the server to return the status of my reservation. So I wrote this WSDL document, Reservation_WSDL_20_SOAP_12_Multipart.wsdl:

<?xml version="1.0"?>
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl"
  xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
  xmlns:hy="https://www.herongyang.com/Service/"
  targetNamespace="https://www.herongyang.com/Service/">

  <wsdl:documentation>
    Reservation_WSDL_20_SOAP_12_Multipart.wsdl
    Copyright (c) 2009 HerongYang.com. All Rights Reserved.
  </wsdl:documentation>

  <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      targetNamespace="https://www.herongyang.com/Service/">
      <xsd:element name="Reservation">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="Member" type="xsd:string"/>
            <xsd:element name="ItemList">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="Item" type="xsd:string"
                    maxOccurs="unbounded"/>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="ReservationResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="Number" type="xsd:string"/>
            <xsd:element name="Status" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>

  <wsdl:interface name="reservationInterface">
    <wsdl:operation name="Reservation"
      pattern="http://www.w3.org/ns/wsdl/in-out"
      style="http://www.w3.org/ns/wsdl/style/multipart">
      <wsdl:input messageLabel="In"
        element="hy:Reservation#element"/>
      <wsdl:output messageLabel="Out"
        element="hy:ReservationResponse"/>
    </wsdl:operation>
  </wsdl:interface>

  <wsdl:binding name="reservationBinding"
    interface="hy:reservationInterface"
    type="http://www.w3.org/ns/wsdl/soap"
    wsoap:version="1.2"
    wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
    <wsdl:operation ref="hy:Reservation"
wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response"/>
  </wsdl:binding>

  <wsdl:service name="reservationService"
    interface="hy:reservationInterface">
    <wsdl:endpoint name="reservationEndpoint"
      binding="hy:reservationBinding"
address="https://www.herongyang.com/Service/Reservation12.php"/>
  </wsdl:service>

</wsdl:description>

See "Request and Response - Book Reservation" tutorial for testing requests and responses.

Table of Contents

 About This Book

 Introduction to WSDL 2.0

 WSDL 2.0 Document Structure and Syntax

 WSDL Version 2.0 Part 2: Adjuncts

WSDL 2.0 Document Examples with SOAP Binding

 No Style Example - Hello

 RPC Style Example - Get Stock Price

 IRI Style Example - Get Exchange Rate

Multiplart Style Example - Reservation

 Using WSDL Document in Java Apache Axis2/Java for WSDL

 Apache Woden for WSDL Documents in Java

 SoapUI - Web Service Testing Tool

 PHP SOAP Extension for WSDL

 Perl SOAP::Lite for WSDL

 Introduction to WSDL 1.1

 WSDL 1.1 Document Structure and Syntax

 WSDL 1.1 Binding Extension for SOAP 1.1

 SoapUI as WSDL 1.1 Testing Tool

 WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles

 PHP SOAP Extension for WSDL 1.1

 Perl SOAP::Lite for WSDL 1.1

 Apache Axis2/Java for WSDL 1.1

 Using WSDL2Java to Generate Web Service Stub Classes

 WSDL 1.1 Binding Extension for SOAP 1.2

 WSDL 1.1 and SOAP 1.2 Examples - Document and RPC Styles

 SOAP 1.2 Binding - PHP, Java and Perl Clients

 Python SOAP Client: Zeep

 WSDL Related Terminologies

 Archived Tutorials

 References

 Full Version in PDF/EPUB