WSDL Message Exchange Patterns

This section describes message exchange patterns defined in WSDL Version 2.0 Part 2: Adjuncts - In-Only, Robust In-Only, and In-Out.

What Is a WSDL Message Exchange Pattern? A WSDL message exchange pattern is a predefined sequence of in/out message of an operation in an abstract interface. Each pattern is represented by a unique URI, which can be specified as the "pattern" attribute of an operation.

WSDL 2.0 specification (WSDL Version 2.0 Part 2: Adjuncts) provides 3 predefined patterns: In-Only, Robust In-Only, and In-Out.

1. In-Only, represented by URI: http://www.w3.org/ns/wsdl/in-only - In-Only pattern defines only 1 single message that goes into the service provider of this operation. This message label is "In" and direction is "in". In-Only pattern does not allow any fault messages. Here is an example operation that uses the In-Only pattern:

    <wsdl:operation name="SnowDay" 
      pattern="http://www.w3.org/ns/wsdl/in-only" 
      style="http://www.w3.org/ns/wsdl/style/iri">
      <wsdl:input messageLabel="In" 
        element="hy:SnowDayAnnouncement"/>
    </wsdl:operation>

2. Robust In-Only, represented by URI: http://www.w3.org/ns/wsdl/robust-in-only - Robust In-Only pattern defines only 1 single message that goes into the service provider of this operation. This message label is "In" and direction is "in". Robust In-Only pattern needs a fault message in the "out" direction. The fault message will be triggered by the input message, if needed. Here is an example operation that uses the Robust In-Only pattern:

  <wsdl:interface name="AlertInterface" >
    <wsdl:fault name="invalidEmailFault" element="InvalidEmail"/>
    <wsdl:operation name="SendAlert" 
      pattern="http://www.w3.org/ns/wsdl/robust-in-only"
      style="http://www.w3.org/ns/wsdl/style/iri">
      <wsdl:input messageLabel="In" 
        element="hy:AlertEmail"/>
      <wsdl:outfault ref="invalidEmailFault" messageLabel="Out"/>
    </wsdl:operation>
  </wsdl:interface>

3. In-Out, represented by URI: http://www.w3.org/ns/wsdl/in-out - In-Out pattern defines 2 messages: an input message followed by an output message. The input message is labeled as "In" and has a direction of "in". The output message is labeled as "Out" and has a direction of "out". In-Out pattern needs a fault message in the "out" direction. The service provider may replace the output message by the fault message, if needed. Here is an example operation that uses the In-Out pattern:

  <wsdl:interface name="GetQuoteInterface" >
    <wsdl:fault name="marketClosedFault" element="MarketClosed"/>
    <wsdl:operation name="GetQuote" 
      pattern="http://www.w3.org/ns/wsdl/in-out"
      style="http://www.w3.org/ns/wsdl/style/iri">
      <wsdl:input messageLabel="In" 
        element="hy:GetQuoteRequest"/>
      <wsdl:output messageLabel="Out" 
        element="hy:GetQuoteResponse"/>
      <wsdl:outfault ref="marketClosedFault" messageLabel="Out"/>
    </wsdl:operation>
  </wsdl:interface>

Some Web sites include other message exchange patterns like In-Optional-Out, Out-Only, Robust Out-Only, Out-In, Out-Optional-In, etc. as part of the WSDL 2.0. But I can not find them in the WSDL 2.0 2007 specification.

Last update: 2009.

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 Message Exchange Patterns

 wsdlx:safe="true|false" Operation Safety

 Operation Message Styles

 SOAP Binding Extension

 SOAP 1.2 Binding Rules

 WSDL 2.0 Document Examples with SOAP Binding

 WSDL 20 Programming APIs and Testing Tools

 Introduction to WSDL 1.1

 WSDL 1.1 Document Structure and Syntax

 WSDL 1.1 Binding Extension for SOAP 1.1

 soapUI 3.0.1 - Web Service Testing Tool

 WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles

 PHP SOAP Extension in PHP 5.3.1

 Using WSDL in Perl with SOAP::Lite 0.710

 Using WSDL Document in Java with Axis2 1.4.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

 WSDL Related Terminologies

 References

 PDF Printing Version