
Originally Posted by
dcaylor
I figured out what I was doing wrong. So I thought I'd post the answer in case anybody else is trying to figure out how to use these.
I was trying to use CreateLDAPEntryRequest to add an attribute to an existing record. It doesn't do that. It adds new records. To add attributes I should have been using ModifyLDAPEntryRequest.
A simplistic use of CreateLDAPEntryRequest looks like this:
<CreateLDAPEntryResponse xmlns="urn:zimbraAdmin">
<LDAPEntry name="Foo Bar">
<a n="sn">Bar</a>
<a n="objectClass">organizationalPerson</a>
<a n="cn">Foo Bar</a>
</LDAPEntry>
</CreateLDAPEntryResponse>
This is obviously useless in the Zimbra context, but it is an example of a working SOAP call.
A working ModifyLDAPEntryRequest looks like this:
<ns1:ModifyLDAPEntryRequest>
<dn>uid=dtest,ou=people,dc=example,dc=com</dn>
<a n="l">Anytown</a>
<a n="street">101 East Main Street</a>
</ns1:ModifyLDAPEntryRequest>
Again, you wouldn't actually do that for these attributes, since ModifyAccountRequest would be more appropriate here, but this does show the working syntax for ModifyLDAPEntryRequest.
And a working GetLDAPEntrysRequest looks like this (the ldapSearchBase and query are just typical LDAP values)
<ns1:GetLDAPEntrysRequest>
<ldapSearchBase>dc=com</ldapSearchBase>
<query>( & (co=US)(givenName=*Dav*))</query>
</ns1:GetLDAPEntrysRequest>