 |  
Examples
Add Example
This DSML request adds a new entry with the Distinguished Name
cn=Test,ou=1060Research,dc=1060,dc=org .
<ds:batchRequest xmlns:ds="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" processing="parallel">
<ds:addRequest dn="cn=Test,ou=1060Research,dc=1060,dc=org">
<ds:attr name="objectclass"> <ds:value>top</ds:value> </ds:attr>
<ds:attr name="objectclass"> <ds:value>person</ds:value> </ds:attr>
<ds:attr name="objectclass"> <ds:value>organizationalPerson</ds:value> </ds:attr>
<ds:attr name="objectclass"> <ds:value>inetOrgPerson</ds:value> </ds:attr>
<ds:attr name="cn"> <ds:value>Test</ds:value> </ds:attr>
<ds:attr name="sn"> <ds:value>Test</ds:value> </ds:attr>
<ds:attr name="givenName"> <ds:value>Test</ds:value> </ds:attr>
<ds:attr name="title"> <ds:value>A Test Addition</ds:value> </ds:attr>
</ds:addRequest> </ds:batchRequest>
When this request is made with the ldapBatch service it returns a DSML response document.
Search Example
This DSML performs two search.
The first searches for all entries with a surname (sn) matching either 'rod' or 'but'.
The second search looks for sn fields with 'Tes'.
<ds:batchRequest xmlns:ds="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" processing="parallel">
<ds:searchRequest derefAliases="neverDerefAliases" dn="dc=1060,dc=org" scope="wholeSubtree" sizeLimit="1000">
<ds:filter>
<ds:or>
<ds:substrings name="sn"> <ds:any>rod</ds:any> </ds:substrings>
<ds:substrings name="sn"> <ds:any>but</ds:any> </ds:substrings>
</ds:or>
</ds:filter>
</ds:searchRequest>
<ds:searchRequest derefAliases="neverDerefAliases" dn="dc=1060,dc=org" scope="wholeSubtree" sizeLimit="1000">
<ds:filter>
<ds:substrings name="sn"> <ds:any>Tes</ds:any> </ds:substrings>
</ds:filter>
</ds:searchRequest> </ds:batchRequest>
The DSML response contains the matching entries for each of the searches.
Multi-step Example
Here is complex example - the operations performed sequentially are as follows...
- Add a new entry under the 1060Research organization unit
- Search for sn matching 'Test'
- Modify the entry Test - change mail, sn, etc
- Change the distinguished name for Test to cn=John Smith,ou=1060Research,dc=1060,dc=org
- Assert that the sn is Smith for cn=John Smith,ou=1060Research,dc=1060,dc=org
- Delete the John Smith entry
< ds: batchRequest xmlns:ds=" urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" processing=" sequential">
<!---->
< ds: addRequest dn=" cn=Test,ou=1060Research,dc=1060,dc=org">
< ds: attr name=" objectclass"> < ds: value> top</ ds: value> </ ds: attr>
< ds: attr name=" objectclass"> < ds: value> person</ ds: value> </ ds: attr>
< ds: attr name=" objectclass"> < ds: value> organizationalPerson</ ds: value> </ ds: attr>
< ds: attr name=" objectclass"> < ds: value> inetOrgPerson</ ds: value> </ ds: attr>
< ds: attr name=" cn"> < ds: value> Test</ ds: value> </ ds: attr>
< ds: attr name=" sn"> < ds: value> Test</ ds: value> </ ds: attr>
< ds: attr name=" givenName"> < ds: value> Test</ ds: value> </ ds: attr>
< ds: attr name=" title"> < ds: value> A Test Addition</ ds: value> </ ds: attr>
</ ds: addRequest>
<!---->
< ds: searchRequest derefAliases=" neverDerefAliases" dn=" dc=1060,dc=org" scope=" wholeSubtree" sizeLimit=" 1000">
< ds: filter> < ds: substrings name=" sn"> < ds: any> Test</ ds: any> </ ds: substrings> </ ds: filter>
</ ds: searchRequest>
<!----> < ds: modifyRequest dn=" cn=Test,ou=1060Research,dc=1060,dc=org">
< ds: modification name=" mail" operation=" add"> < value> [email protected]</ value> </ ds: modification>
< ds: modification name=" sn" operation=" replace"> < value> Smith</ value> </ ds: modification>
< ds: modification name=" mail" operation=" replace"> < value> [email protected]</ value> </ ds: modification>
< ds: modification name=" givenName" operation=" replace"> < value> smithy</ value> </ ds: modification> </ ds: modifyRequest>
<!---->
< modDNRequest deleteoldrdn=" true" dn=" cn=Test,ou=1060Research,dc=1060,dc=org" newSuperior=" ou=1060research,dc=1060,dc=org" newrdn=" cn=John Smith" />
< ds: searchRequest derefAliases=" neverDerefAliases" dn=" dc=1060,dc=org" scope=" wholeSubtree" sizeLimit=" 1000">
< ds: filter> < ds: substrings name=" sn"> < ds: any> Smith</ ds: any> </ ds: substrings> </ ds: filter>
</ ds: searchRequest>
<!----> < ds: compareRequest dn=" cn=John Smith,ou=1060Research,dc=1060,dc=org">
< ds: assertion name=" sn"> < ds: value> Smith</ ds: value> </ ds: assertion>
</ ds: compareRequest>
<!----> < ds: delRequest dn=" cn=John Smith,ou=1060Research,dc=1060,dc=org" /> </ ds: batchRequest>
|