<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 
(c) 2002-2004 BEA Systems Inc., International Business Machines Corporation, 
Microsoft Corporation, Inc., and TIBCO Software Inc. All rights reserved.

BEA Systems, IBM, Microsoft, and TIBCO Software (collectively, the "Authors")
hereby grant you permission to copy and display the
WS-ReliableMessaging Schema (the Document), in any medium without fee
or royalty, provided that you include the following on ALL copies of
the Document, or portions thereof, that you make:

1. A link or URL to the Document at this location.
2. The copyright notice as shown in the WS-ReliableMessaging Schema.

EXCEPT FOR THE COPYRIGHT LICENSE GRANTED ABOVE, THE AUTHORS DO NOT GRANT, 
EITHER EXPRESSLY OR IMPLIEDLY, A LICENSE TO ANY INTELLECTUAL PROPERTY, 
INCLUDING PATENTS, THEY OWN OR CONTROL.

THE DOCUMENT 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 DOCUMENT 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 DOCUMENT.

The Document may change before final release and you are cautioned against 
relying on the content of this Document.

The name and trademarks of the Authors may NOT be used in any manner, 
including advertising or publicity pertaining to the Document or its 
contents without specific, written prior permission. Title to copyright in 
the Document 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/03/rm" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsrm="http://schemas.xmlsoap.org/ws/2004/03/rm" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://schemas.xmlsoap.org/ws/2002/07/utility" schemaLocation="http://schemas.xmlsoap.org/ws/2002/07/utility"/>
  <!-- Protocol Elements -->
  <xs:complexType name="SequenceType">
    <xs:sequence>
      <xs:element ref="wsu:Identifier"/>
      <xs:element name="MessageNumber" type="xs:unsignedLong"/>
      <xs:element name="LastMessage" minOccurs="0"/>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax"/>
  </xs:complexType>
  <xs:element name="Sequence" type="wsrm:SequenceType"/>
  <xs:element name="SequenceTerminate">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsu:Identifier"/>
        <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="SequenceAcknowledgement">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsu:Identifier"/>
        <xs:choice>
          <xs:element name="AcknowledgementRange" maxOccurs="unbounded">
            <xs:complexType>
              <xs:sequence/>
              <xs:attribute name="Upper" type="xs:unsignedLong" use="required"/>
              <xs:attribute name="Lower" type="xs:unsignedLong" use="required"/>
            </xs:complexType>
          </xs:element>
          <xs:element name="Nack" type="xs:unsignedLong" maxOccurs="unbounded"/>
        </xs:choice>
        <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="AckRequestedType">
    <xs:sequence>
      <xs:element ref="wsu:Identifier"/>
      <xs:element name="MaxMessageNumberUsed" type="xs:unsignedLong" minOccurs="0"/>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax"/>
  </xs:complexType>
  <xs:element name="AckRequested" type="wsrm:AckRequestedType"/>
  <!-- Policy Assertions -->
  <xs:element name="InactivityTimeout">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="wsrm:PolicyAssertionType">
          <xs:attribute name="Milliseconds" type="xs:unsignedLong" use="required"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="BaseRetransmissionInterval">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="wsrm:PolicyAssertionType">
          <xs:attribute name="Milliseconds" type="xs:unsignedLong" use="required"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="ExponentialBackoff" type="wsrm:PolicyAssertionType"/>
  <xs:element name="AcknowledgementInterval">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="wsrm:PolicyAssertionType">
          <xs:attribute name="Milliseconds" type="xs:unsignedLong" use="required"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="PolicyAssertionType">
    <xs:sequence>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:element name="SequenceCreation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="wsrm:PolicyAssertionType">
          <xs:attribute name="Value" type="xs:QName" use="required"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!-- Fault Container and Codes -->
  <xs:simpleType name="FaultCodes">
    <xs:restriction base="xs:QName">
      <xs:enumeration value="wsrm:UnknownSequence"/>
      <xs:enumeration value="wsrm:SequenceTerminated"/>
      <xs:enumeration value="wsrm:InvalidAcknowledgement"/>
      <xs:enumeration value="wsrm:MessageNumberRollover"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Direction">
    <xs:restriction base="xs:QName">
      <xs:enumeration value="wsrm:Inbound"/>
      <xs:enumeration value="wsrm:Outbound"/>
      <xs:enumeration value="wsrm:Bidirectional"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SequenceFaultType">
    <xs:sequence>
      <xs:element name="FaultCode" type="xs:QName"/>
      <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##any" processContents="lax"/>
  </xs:complexType>
  <xs:element name="SequenceFault" type="wsrm:SequenceFaultType"/>
  <!-- Sequence Reference Domain Expression -->
  <xs:complexType name="SequenceRefType">
    <xs:sequence>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Identifier" type="xs:anyURI" use="required"/>
    <xs:attribute name="Match" type="wsrm:MatchChoiceType" use="optional"/>
    <xs:anyAttribute/>
  </xs:complexType>
  <xs:simpleType name="MatchChoiceType">
    <xs:restriction base="xs:QName">
      <xs:enumeration value="wsrm:Exact"/>
      <xs:enumeration value="wsrm:Prefix"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="SequenceRef" type="wsrm:SequenceRefType"/>
  <xs:element name="CreateSequence">
    <xs:complexType>
      <xs:sequence>
        <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:anyAttribute namespace="##other"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="CreateSequenceResponse" type="wsrm:HandshakeType"/>
  <xs:element name="TerminateSequence" type="wsrm:HandshakeType"/>
  <xs:complexType name="HandshakeType">
    <xs:sequence>
      <xs:element ref="wsu:Identifier"/>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax"/>
  </xs:complexType>
</xs:schema>
