<?xml version="1.0" encoding="UTF-8"?>
<!-- 
Legal Disclaimer

The presentation, distribution or other dissemination of the information 
contained in this specification is not a license, either expressly or impliedly, 
to any intellectual property owned or controlled by Microsoft and\or any other 
third party.  Microsoft and\or any other third party may have patents, patent 
applications, trademarks, copyrights, or other intellectual property rights 
covering subject matter in this document.  The furnishing of this document 
does not give you any license to Microsoft's or any other third party's patents, 
trademarks, copyrights, or other intellectual property.

This specification and the information contained herein is provided on an "AS IS"
 basis and to the maximum extent permitted by applicable law, Microsoft provides 
the document AS IS AND WITH ALL FAULTS, and hereby disclaims all other warranties 
and conditions, either express, implied or statutory, including, but not limited 
to, any (if any) implied warranties, duties or conditions of merchantability, of 
fitness for a particular purpose, of accuracy or completeness of responses, of 
results, of workmanlike effort, of lack of viruses, and of lack of negligence, 
all with regard to the document. ALSO, THERE IS NO WARRANTY OR CONDITION OF 
TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 
NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE DOCUMENT.

IN NO EVENT WILL MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING 
SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY 
INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER 
CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY 
OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE 
NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.

Copyright Notice

Copyright 2001, 2002 Microsoft Corporation. All rights reserved.
-->
<xsd:schema targetNamespace="http://schemas.xmlsoap.org/ws/2002/01/secext"
                        xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                        xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/01/secext" 
                        xmlns="http://schemas.xmlsoap.org/ws/2002/01/secext" 
                        elementFormDefault="qualified" 
                        attributeFormDefault="unqualified" version="0.1">
  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
                       schemaLocation="http://www.w3.org/2001/xml.xsd"/>
  <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#"
                       schemaLocation="http://www.w3.org/TR/2001/PR-xmldsig-core-20010820/xmldsig-core-schema.xsd"/>

  <!--
    // 
    // WS-Security includes the following elements used to extend ds:KeyInfo:
    //  - licenseLocation
    //  - address (contained within licenseLocation)
    //
    -->
    <xsd:element name="licenseLocation">
        <xsd:annotation>
            <xsd:documentation>
            This element is used within an XML Signature KeyInfo tag to
            provide a pointer to a assertion/license that may be useful in
            determining the trust associated with an XML Signature.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:choice maxOccurs="unbounded">
                 <xsd:element ref="address"/>
                 <xsd:any namespace="##other" processContents="lax" 
                                  minOccurs="0" maxOccurs="unbounded"/>
            </xsd:choice>
            <xsd:anyAttribute namespace="##other" processContents="lax"/>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="address" type="xsd:anyURI">
        <xsd:annotation>
            <xsd:documentation>
            This element is used within licenseLocation to provide a URI to the
            assertion/license.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

  <!--
    //
    // WS-Security includes the following top level SOAP Headers:
    //  - credentials
    //  - integrity
    //  - confidentiality
    //
    -->

  <!--
    //
    // WS-Security credentials header
    //
    -->
    <xsd:element name="credentials" type="wsse:CREDENTIALS">
        <xsd:annotation>
            <xsd:documentation>
                This element defines the WS-Security credentials header.
                It's purpose is to encapsulate credentials that 
                are agreed to between the SOAP producer and consumer. This header
                is designed to allow all valid SOAP attributes as well
                as other namespace qualified attributes that are appropriate
                in the context that this is being used within.
           </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

  <!--
    //
    // WS-Security message integrity header
    //
    -->
    <xsd:element name="integrity">
        <xsd:annotation>
            <xsd:documentation>
            This element defines the WS-Security integrity header.
            It's purpose is to encapsulate the XML digital signatures 
            of the SOAP message that contains this header.  This header
            is designed to allow all valid SOAP attributes as well
            as other namespace qualified attributes that are appropriate
            in the context that this is being used within.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:sequence>
                <xsd:any namespace="##other" processContents="lax" 
                                minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation>
                                The use of "any" is to allow extensibility.  It is expected that "Signature" elements
                                from XML Signature be used here.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:any>
            </xsd:sequence>
            <xsd:anyAttribute namespace="##other" processContents="lax"/>
        </xsd:complexType>
    </xsd:element>

  <!--
    //
    // WS-Security message confidentiality header
    //
    -->
    <xsd:element name="confidentiality">
        <xsd:annotation>
            <xsd:documentation>
                This element defines the WS-Security confidentiality header.
                It's purpose is to identify encrypted parts or attachments.  This header
                is designed to allow all valid SOAP attributes as well
                as other namespace qualified attributes that are appropriate
                in the context that this is being used within.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:sequence>
                <xsd:any namespace="##other" processContents="lax" 
                                minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation>
                            The use of "any" is to allow extensibility.  It is expected that "EncryptedData" elements
                            from XML Encryption be used here.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:any>
            </xsd:sequence>
            <xsd:anyAttribute namespace="##other" processContents="lax"/>
        </xsd:complexType>
    </xsd:element>


  <!-- 
    // WS-License Schema Elements
  -->


  <!-- 
    // valueType attribute - use to define the value space of binary encoded data
  -->
  <xsd:attribute name="valueType" type="xsd:QName">
    <xsd:annotation>
      <xsd:documentation>
          This attribute is used to identify the value space of the binary data.
          Its form  and function is like that of xsi:type, except that it asserts a constraint
          on the type, not of the immediate contents, but the contents after decoding.
       </xsd:documentation>
    </xsd:annotation>
  </xsd:attribute>

  <!-- 
  // encodingType attribute - use to define the encoding format of binary encoded data
  -->
<xsd:attribute name="encodingType" type="xsd:QName">
    <xsd:annotation>
      <xsd:documentation> 
          This attribute is used to identify the binary encoding used for a credential/license.
      </xsd:documentation>
    </xsd:annotation>
  </xsd:attribute>

  <!--
  // abstractCredential - abstract base class for all credentials
  -->
  <xsd:element name="abstractCredential" abstract="true"/>
  
<!--
  // abstractLicense - abstract base class for all licenses
  -->
  <xsd:element name="abstractLicense" abstract="true" substitutionGroup="wsse:abstractCredential"/>

  <!--
  // BASE64_BINARY_LICENSE - type for binaryLicense element
  -->
  <xsd:complexType name="BASE64_BINARY_LICENSE">
    <xsd:simpleContent>
      <xsd:extension base="xsd:string">
        <xsd:attribute name="id" type="xsd:ID"/>
        <xsd:attribute ref="wsse:valueType"/>
        <xsd:attribute ref="wsse:encodingType"/>
        <xsd:anyAttribute namespace="##other" processContents="strict"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

  <!--
  // BASE64_BINARY_CREDENTIAL - type for the binaryCredential element
  -->
  <xsd:complexType name="BASE64_BINARY_CREDENTIAL">
    <xsd:simpleContent>
      <xsd:extension base="xsd:string">
        <xsd:attribute name="id" type="xsd:ID"/>
        <xsd:attribute ref="wsse:valueType"/>
        <xsd:attribute ref="wsse:encodingType"/>
        <xsd:anyAttribute namespace="##other" processContents="strict"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

  <!--
  // binaryLicense - element for passing binary licenses
  -->
  <xsd:element name="binaryLicense" substitutionGroup="wsse:abstractLicense">
    <xsd:annotation>
      <xsd:documentation>A license that is encoded in binary</xsd:documentation>
    </xsd:annotation>
  </xsd:element>

  <!--
  // binaryCredential - element for passing binary credentials (non-licenses)
  -->
  <xsd:element name="binaryCredential" substitutionGroup="wsse:abstractCredential">
    <xsd:annotation>
      <xsd:documentation>
          A credential that is encoded in binary
      </xsd:documentation>
    </xsd:annotation>
  </xsd:element>

  <!--
  // CREDENTIALS - type associated with wsse:credentials header
  -->
  <xsd:complexType name="CREDENTIALS">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element ref="wsse:abstractCredential"/>
      <xsd:element ref="ds:KeyInfo"/>
    </xsd:choice>
    <xsd:attribute name="id" type="xsd:ID"/>
    <xsd:anyAttribute namespace="##other" processContents="lax"/>
  </xsd:complexType>

  <!--
    // pre-defined binaryLicense value types for use with wsse:valueType
  -->
  <xsd:complexType name="x509v3"/>
  <xsd:complexType name="kerberosv5"/>

  <!--
    // Fault Codes
  -->
<xsd:simpleType name="faultcodeEnum">
  <xsd:restriction base="xsd:QName">
    <xsd:enumeration value="wsse:unsupportedLicense"/>
    <xsd:enumeration value="wsse:unsupportedIntegrity"/>
    <xsd:enumeration value="wsse:unsupoprtedConfidentiality"/>
    <xsd:enumeration value="wsse:invalidLicense"/>
    <xsd:enumeration value="wsse:failedAuthenticate"/>
    <xsd:enumeration value="wsse:failedCheck"/>
  </xsd:restriction>
</xsd:simpleType>

</xsd:schema>