LDAPLookupRequest request = new LDAPLookupRequest(); request.setName("cn=John Doe,ou=Finance,o=XYZ Corp,c=US"); LDAPService service = (LDAPService)Service.readObject("aLdapService"); service.initialize(); LDAPResponse response = service.performRequest(request);
(At this point the application can read and use the result of the request from the response object.)
LDAPService aService = null; LDAPRequest request = null; LDAPResponse = null; /* configure the service */ aService.setAuthenticationCredentials("password"); aService.setAuthenticationMethod("simple"); aService.setAuthenticationPrincipal("cn=root"); aService.setProviderFactory("com.sun.jndi.ldap.LdapCtxFactory"); aService.setProviderUrl("ldap://localhost:389"); /* obtain request model */ request = new LDAPLookupRequest(); /* set input data */ request.setName("cn=Ted Geisel,ou=Finance,o=XYZ Corp,c=US"); /* utilize the service */ aService.initialize(); response = aService.performRequest(request);