<?xml version="1.0" encoding="UTF-8"?>
<!--
(c) 2004 Microsoft Corporation, Inc. All rights reserved.

Permission to copy and display the WS-Discovery Specification (the "Specification", which includes WSDL and schema documents), in any medium without fee or royalty is hereby granted, provided that you include the following on ALL copies of the Specification that you make:

1.  A link or URL to the Specification at one of the Co-Developers' websites
2.  The copyright notice as shown in the Specification.

BEA Systems, Canon, Intel, Microsoft, and webMethods, Inc. (collectively, the "Co-developers") each agree to grant you a license, under reasonable, non-discriminatory terms and conditions, to their respective essential Licensed Claims, which reasonable, non-discriminatory terms and conditions may include, for example, the payment of royalties and an affirmation of the obligation to grant reciprocal licenses under any of the licensee's patents that are necessary to implement the Specification.

THE SPECIFICATION IS PROVIDED "AS IS," AND THE CO-DEVELOPERS 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 SPECIFICATION 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 CO-DEVELOPERS 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 SPECIFICATION.

The name and trademarks of the Co-developers may NOT be used in any manner, including advertising or publicity pertaining to the Specification or its contents without specific, written prior permission. Title to copyright in the Specification will at all times remain with Microsoft.

No other rights are granted by implication, estoppel or otherwise.
-->
<xs:schema
    targetNamespace="http://schemas.xmlsoap.org/ws/2004/10/discovery"
    xmlns:tns="http://schemas.xmlsoap.org/ws/2004/10/discovery"
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    blockDefault="#all" >

  <xs:import
      namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"
      schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/addressing" />

  <!-- //////////////////// Discovery Messages //////////////////// -->

  <xs:element name="Hello" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsa:EndpointReference" />
        <xs:element ref="tns:Types" minOccurs="0" />
        <xs:element ref="tns:Scopes" minOccurs="0" />
        <xs:element ref="tns:XAddrs" minOccurs="0" />
        <xs:element ref="tns:MetadataVersion" />
        <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="Bye" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsa:EndpointReference" />
        <xs:any namespace="##any"
                processContents="lax"
                minOccurs="0"
                maxOccurs="unbounded" />
        <!-- ##any allows simplifying an implementation to send the
             same children in Bye as in Hello --> 
      </xs:sequence>
      <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>
  </xs:element>

  <xs:element name="Probe" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="tns:Types" minOccurs="0" />
        <xs:element ref="tns:Scopes" minOccurs="0" />
        <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="ProbeMatches" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="tns:ProbeMatch" minOccurs="0" />
        <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="ProbeMatch" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsa:EndpointReference" />
        <xs:element ref="tns:Types" minOccurs="0" />
        <xs:element ref="tns:Scopes" minOccurs="0" />
        <xs:element ref="tns:XAddrs" minOccurs="0" />
        <xs:element ref="tns:MetadataVersion" />
        <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="Resolve" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsa:EndpointReference" />
        <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="ResolveMatch" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsa:EndpointReference" />
        <xs:element ref="tns:Types" minOccurs="0" />
        <xs:element ref="tns:Scopes" minOccurs="0" />
        <xs:element ref="tns:XAddrs" />
        <xs:element ref="tns:MetadataVersion" />
        <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="Types" type="tns:QNameListType" />

  <xs:simpleType name="QNameListType" >
    <xs:list itemType="xs:QName" />
  </xs:simpleType>

  <xs:element name="Scopes" >
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="tns:UriListType" >
          <xs:attribute name="MatchBy" type="xs:anyURI" />
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="XAddrs" type="tns:UriListType" />

  <xs:simpleType name="UriListType" >
    <xs:list itemType="xs:anyURI" />
  </xs:simpleType>

  <xs:element name="MetadataVersion" type="xs:nonNegativeInteger" />

  <!-- //////////////////// Compact Signature //////////////////// -->

  <xs:attribute name="Id" type="xs:ID"/>

  <xs:element name="Security" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="tns:Sig" minOccurs="0" />
      </xs:sequence>
      <xs:anyAttribute namespace="##any" processContents="lax" />
    </xs:complexType> 
  </xs:element>

  <xs:element name="Sig" >
    <xs:complexType>
      <xs:sequence>
        <xs:any namespace="##any"
                processContents="lax"
                minOccurs="0"
                maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="Scheme" type="xs:anyURI" use="required" />
      <xs:attribute name="KeyId" type="xs:base64Binary" />
      <xs:attribute name="Refs" type="xs:IDREFS" use="required" />
      <xs:attribute name="Sig" type="xs:base64Binary" use="required" />
      <xs:anyAttribute namespace="##any" processContents="lax" />
    </xs:complexType> 
  </xs:element>

  <!-- //////////////////// General Headers //////////////////// -->

  <xs:element name="AppSequence" >
   <xs:complexType>
    <xs:complexContent>
     <xs:restriction base="xs:anyType" >
      <xs:attribute name="InstanceId"
                    type="xs:positiveInteger"
                    use="required" />
      <xs:attribute name="SequenceId" type="xs:anyURI" />
      <xs:attribute name="MessageNumber"
                    type="xs:positiveInteger"
                    use="required" />
      <xs:anyAttribute namespace="##any" processContents="lax" />
     </xs:restriction>
    </xs:complexContent>
   </xs:complexType>
  </xs:element>

</xs:schema>
