<?xml version="1.0" encoding="utf-8" ?>

<!-- 

Schema for DSSP/1.0

Microsoft's patent rights to this version 1.0 of the specification (the 
"Specification") are being made available under Microsoft's Open Specification 
Promise, which you can review at http://www.microsoft.com/interop/osp/default.mspx.
Microsoft also grants you a royalty-free copyright license to copy, distribute,
publicly display, and publicly perform the Specification.  By providing any
comments, feedback, or other input ("Feedback") to Microsoft that is 
incorporated into the Specification or any future version of the Specification,
you agree that you will make your and your affiliates' patent rights in that
Feedback available under the same terms and conditions as Microsoft makes its 
patent rights available under the Open Specification Promise.  You also grant 
Microsoft, its affiliates, and third parties a perpetual, irrevocable and 
royalty-free copyright license to copy, distribute, publicly display, publicly 
perform and create derivative works of such Feedback.  In addition, you 
represent and warrant that you have all rights necessary to provide the 
Feedback subject to these terms and that the Feedback is not confidential.

-->

<xs:schema targetNamespace="http://schemas.microsoft.com/xw/2004/10/dssp.html"
  xmlns:tns="http://schemas.microsoft.com/xw/2004/10/dssp.html"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
  elementFormDefault="qualified"
  attributeFormDefault="unqualified"
  finalDefault="#all"
  blockDefault="#all">

  <xs:import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"
             schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/addressing" />

  <!-- These are standard URIs for use in wsa:Action and tns:NotifyAction -->
  <xs:simpleType name="DsspActionEnum">
    <xs:restriction base="xs:anyURI">
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:CreateRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:CreateResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:DeleteRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:DeleteResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:DropRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:DropResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:GetRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:GetResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:InsertRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:InsertResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:LookupRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:LookupResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:NotifyRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:NotifyResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:QueryRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:QueryResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:ReplaceRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:ReplaceResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:SubmitRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:SubmitResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:SubscribeRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:SubscribeResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:UpdateRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:UpdateResponse" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:UpsertRequest" />
      <xs:enumeration value="http://schemas.microsoft.com/xw/2004/10/dssp.html:UpsertResponse" />
    </xs:restriction>
  </xs:simpleType>

  <!-- DSSP notify messages carry the original wsa:Action header here -->
  <xs:element name="NotifyAction" type="wsa:AttributedURI" />

  <!-- COMMON TYPES -->

  <xs:complexType name="PartnerType">
    <xs:complexContent>
      <xs:extension base="tns:ServiceInfoType">
        <xs:sequence>
          <xs:element name="Name" type="xs:QName" minOccurs="0" />
          <xs:element name="ServiceDirectory" type="xs:anyURI" minOccurs="0" maxOccurs="1" />
          <xs:element name="ServiceName" type="xs:QName" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="PartnerListType">
    <xs:sequence>
      <xs:element name="Partner" type="tns:PartnerType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="AliasListType">
    <xs:sequence>
      <xs:element name="Alias" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ServiceInfoType" final="">
    <xs:sequence>
      <xs:element name="Contract" type="xs:anyURI" minOccurs="0" />
      <xs:element name="Service" type="xs:anyURI" minOccurs="0" />
      <xs:element name="AliasList" type="tns:AliasListType" minOccurs="0" />
      <xs:element name="PartnerList" type="tns:PartnerListType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

  <!-- DSSP OPERATIONS
  Notes:
  1) Message operations that are service specific are declared as abstract
  2) Abstract types have a default non-abstract substitution declaration that may be used if convenient
  3) All abstract element declarations are of type xs:anyType facilitating derivations
  4) Head of substitutions groups are declared final=""
  -->

  <!-- CREATE -->
  <xs:element name="CreateRequest" type="tns:ServiceInfoType" />

  <xs:element name="CreateResponse" type="tns:ServiceInfoType" />

  <!-- DELETE -->
  <xs:element name="DeleteRequest" type="xs:anyType" block="" final="" abstract="true" />

  <xs:element name="DeleteResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultDeleteResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultDeleteResponse" type="tns:DefaultDeleteResponseType"
    substitutionGroup="tns:DeleteResponse" />

  <!-- DROP -->
  <xs:complexType name="DropRequestType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DropRequest" type="tns:DropRequestType"/>

  <xs:element name="DropResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultDropResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultDropResponse" type="tns:DefaultDropResponseType"
    substitutionGroup="tns:DropResponse" />

  <!-- GET -->
  <xs:complexType name="GetRequestType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType"/>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="GetRequest" type="tns:GetRequestType"/>

  <xs:element name="GetResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultGetResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultGetResponse" type="tns:DefaultGetResponseType"
    substitutionGroup="tns:GetResponse" />

  <!-- INSERT -->
  <xs:element name="InsertRequest" type="xs:anyType" block="" final="" abstract="true" />

  <xs:element name="InsertResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultInsertResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultInsertResponse" type="tns:DefaultInsertResponseType"
    substitutionGroup="tns:InsertResponse" />

  <!-- LOOKUP -->
  <xs:complexType name="LookupRequestType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="LookupRequest" type="tns:LookupRequestType" />

  <xs:element name="LookupResponse" type="tns:ServiceInfoType" />

  <!-- QUERY -->
  <xs:element name="QueryRequest" type="xs:anyType" block="" final="" abstract="true" />

  <xs:element name="QueryResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultQueryResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultQueryResponse" type="tns:DefaultQueryResponseType"
     substitutionGroup="tns:QueryResponse" />

  <!-- REPLACE -->
  <xs:element name="ReplaceRequest" type="xs:anyType" block="" final="" abstract="true" />

  <xs:element name="ReplaceResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultReplaceResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultReplaceResponse" type="tns:DefaultReplaceResponseType"
    substitutionGroup="tns:ReplaceResponse" />

  <!-- SUBMIT -->
  <xs:element name="SubmitRequest" type="xs:anyType" block="" final="" abstract="true" />

  <xs:element name="SubmitResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultSubmitResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultSubmitResponse" type="tns:DefaultSubmitResponseType"
    substitutionGroup="tns:SubmitResponse" />

  <!-- SUBSCRIBE -->
  <xs:complexType name="SubscribeRequestType" final="">
    <xs:sequence>
      <xs:element name="Subscriber" type="xs:anyURI" />
      <xs:element name="Duration" type="xs:long" minOccurs="0" />
      <xs:element name="NotificationCount" type="xs:int" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="SubscribeRequest" type="tns:SubscribeRequestType" block="" final="" />

  <xs:complexType name="SubscribeResponseType" final="">
    <xs:sequence>
      <xs:element name="SubscriptionManager" type="xs:anyURI" />
      <xs:element name="LeaseDuration" type="xs:long" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="SubscribeResponse" type="tns:SubscribeResponseType" block="" final="" />

  <!-- UPDATE -->
  <xs:element name="UpdateRequest" type="xs:anyType" block="" final="" abstract="true" />

  <xs:element name="UpdateResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultUpdateResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultUpdateResponse" type="tns:DefaultUpdateResponseType"
    substitutionGroup="tns:UpdateResponse" />

  <!-- UPSERT -->
  <xs:element name="UpsertRequest" type="xs:anyType" block="" final="" abstract="true" />

  <xs:element name="UpsertResponse" type="xs:anyType" block="" final="" abstract="true" />

  <xs:complexType name="DefaultUpsertResponseType">
    <xs:complexContent>
      <xs:restriction base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DefaultUpsertResponse" type="tns:DefaultUpsertResponseType"
    substitutionGroup="tns:UpsertResponse" />

  <!-- DSSP FAULTS -->

  <!-- The fault codes are either sub-codes of SOAP:Receiver or
  SOAP:Sender meaning that:

  Sender: The message was incorrectly formed or did not contain the
  appropriate information in order to succeed. For example, the
  message could lack the proper authentication or payment
  information. It is generally an indication that the message is not
  to be resent without change.

  Receiver: The message could not be processed for reasons
  attributable to the processing of the message rather than to the
  contents of the message itself. For example, processing could
  include communicating with an upstream SOAP node, which did not
  respond. The message could succeed if resent at a later point in
  time.

  See "http://www.w3.org/TR/soap12-part1/#soapfault" for details on
  SOAP faults.

  -->

  <xs:simpleType name="FaultCodes">
    <xs:restriction base="xs:QName">

      <!-- Operation could not be completed successfullly -->
      <!-- Sub-fault of SOAP:Receiver or SOAP:Sender -->
      <xs:enumeration value="tns:OperationFailed" />

      <!-- Operation could not be completed because of lack of available resources -->
      <!-- Sub-fault of SOAP:Receiver -->
      <xs:enumeration value="tns:InsufficientResources" />

      <!-- The given Action is not supported -->
      <!-- Sub-fault of SOAP:Sender -->
      <xs:enumeration value="tns:ActionNotSupported" />

      <!-- The given message type is not supported -->
      <!-- Sub-fault of SOAP:Sender -->
      <xs:enumeration value="tns:MessageNotSupported" />

      <!-- The INSERT or UPDATE operation failed because of a duplicate entry -->
      <!-- Sub-fault of SOAP:Sender -->
      <xs:enumeration value="tns:DuplicateEntry" />

      <!-- The DELETE or UPDATE operation failed because entry could not be found -->
      <!-- Sub-fault of SOAP:Sender -->
      <xs:enumeration value="tns:UnknownEntry" />

    </xs:restriction>
  </xs:simpleType>

</xs:schema>
