2 Replies Latest reply on Oct 13, 2009 11:41 AM by Keith Barlow

    LDAP Binding via JNDI

    Dan Salt Newbie



      I've successfully used the "camel-ldap" component in ServiceMix to query an external LDAP, but I also need to be able to support adding items too.


      So I tried to switch my code to manually create (via the JNDI Context classes) the connection to LDAP, rather than using the camel-ldap component.


      Trouble is, it doesn't seem to be binding at all, or even trying to connect to the LDAP I specify. When I try and obtain an InitialDirContext, the call completes fine, but the Context is empty. Setting correct and/or fictional Environment properties seems to make no difference - I get no error output.


      Any ideas as to what is wrong here?


      Many Thanks!


        • 1. Re: LDAP Binding via JNDI
          Hadrian Zbarcea Newbie

          Hi Dan,


          Since you had some success with camel-ldap, I would suggest you look at how the the camel-ldap component binds to the ldap server and do something similar.


          You are correct, the camel-ldap component does not currently support adding objects to the ldap server, but another thing you could try is add that support yourself and hopefully submit a patch, or open a jira at apache.  Usually, when there is enough interest in a particular improvement a committer will take up the task. Contributions are highly appreciated.




          • 2. Re: LDAP Binding via JNDI
            Keith Barlow Newbie

            I work with an LDAP repository and would suggest you check out the Spring LDAP project.  This project is designed to simplify LDAP access and can be used to build services for LDAP connectivity.


            The ServiceMix/ESB platform is about integrating applications - not repositories. Services should be designed to interact with repositories in the manner your business logic requires.  ServiceMix can then be used to integrate those services as required.