4.1 WS-Enumerate Directory Services Extension "Enumerate" Request Example

This example demonstrates a [MS-WSDS] Enumerate operation. In this SOAP request message, the requestor is specifying the LDAP query filter for search and directory attributes it requests out of the resultant objects under the selection element. The requestor is also asking to base the sorting of the resultant fragments in the response on the LDAP givenName attribute. The directory instance on which this operation is being performed is identified by its string-valued instance header ldap:389.

  
 <soapenv:Envelope 
       xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" 
       xmlns:wsa="http://www.w3.org/2005/08/addressing">
       <soapenv:Header>
           <wsa:Action soapenv:mustUnderstand="1">
               http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate
           </wsa:Action>
           <instance xmlns="http://schemas.microsoft.com/2008/1/ActiveDirectory">
               ldap:389
           </instance>
           <wsa:MessageID>
               urn:uuid:e36457ff-d0f1-4c85-abe6-6cdf4bd511e9
           </wsa:MessageID>
           <wsa:ReplyTo>
               <wsa:Address>
                   http://www.w3.org/2005/08/addressing/anonymous
               </wsa:Address>
           </wsa:ReplyTo>
           <wsa:To soapenv:mustUnderstand="1">net.tcp://server01.fabrikam.com:9389/ActiveDirectoryWebServices/Windows/Enumeration</wsa:To>
       </soapenv:Header>
       <soapenv:Body>
          <wsen:Enumerate
                xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
                xmlns:adlq="http://schemas.microsoft.com/2008/1/ActiveDirectory/Dialect/LdapQuery"
                xmlns:addata="http://schemas.microsoft.com/2008/1/ActiveDirectory/Data" 
                 xmlns:ad="http://schemas.microsoft.com/2008/1/ActiveDirectory" 
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
             <wsen:Filter Dialect="http://schemas.microsoft.com/2008/1/ActiveDirectory/Dialect/LdapQuery"> 
                 <adlq:LdapQuery> 
                          <adlq:Filter>(objectclass=user)</adlq:Filter>
                          <adlq:BaseObject>cc36a2a7-79a2-4d96-b1c2-31c30493b801</adlq:BaseObject>
                          <adlq:Scope>subtree</adlq:Scope>
                  </adlq:LdapQuery>
              </wsen:Filter>
              <ad:Selection Dialect="http://schemas.microsoft.com/2008/1/ActiveDirectory/Dialect/XPath-Level-1">
                       <ad:SelectionProperty>
                         ad:container-hierarchy-parent
                       </ad:SelectionProperty> 
                       <ad:SelectionProperty>
                         addata:relativeDistinguishedName
                       </ad:SelectionProperty>
                       <ad:SelectionProperty>
                         addata:givenName
                       </ad:SelectionProperty> 
               </ad:Selection> 
               <ad:Sorting Dialect="http://schemas.microsoft.com/2008/1/ActiveDirectory/Dialect/XPath-Level-1">
                       <ad:SortingProperty Ascending="true">
                         addata:givenName
                       </ad:SortingProperty> 
              </ad:Sorting>
          </wsen:Enumerate>
       </soapenv:Body>
  </soapenv:Envelope>