Results 1 to 3 of 3

Thread: [SOLVED] Using CreateLDAPEntryRequest

  1. #1
    dcaylor is offline New Member
    Join Date
    Apr 2007
    Posts
    3
    Rep Power
    8

    Default [SOLVED] Using CreateLDAPEntryRequest

    I'm trying to figure out how to use CreateLDAPEntryRequest. I'm working in PHP on zimbra 4.5.7 with the ldap util extension installed. I have a number of other soap requests working fine, including GetLDAPEntrysRequest.

    My current attempt looks like this:
    <ns1:CreateLDAPEntryRequest>
    <dn>uid=john.test,ou=people,dc=example,dc=com</dn>
    <a n="l">Flagstaff</a>
    </ns1:CreateLDAPEntryRequest>

    This throws an error:
    <soap:faultstring>system failure: createLDAPEntry</soap:faultstring>

    and further down a ways in the detail:
    Caused by: javax.naming.NamingException: [LDAP: error code 80 - no structuralObjectClass operational attribute]; remaining name 'uid=john.test,ou=people,dc=fh,dc=org'

    I've tried a number of variations, but this is the closest I get.

    Is there documentation somewhere for this that I'm missing? What's the proper syntax, and what am I doing wrong?

    Thanks

  2. #2
    dcaylor is offline New Member
    Join Date
    Apr 2007
    Posts
    3
    Rep Power
    8

    Default Using the proper call for the purpose helps

    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>( &amp; (co=US)(givenName=*Dav*))</query>
    </ns1:GetLDAPEntrysRequest>

  3. #3
    JoshuaPrismon is offline Zimlet Guru & Moderator
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    9

    Default

    Quote Originally Posted by dcaylor View Post
    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>( &amp; (co=US)(givenName=*Dav*))</query>
    </ns1:GetLDAPEntrysRequest>
    Thanks for the info!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •