Runtime tools : Service components : LDAP Access Service : Tasks : Using the LDAP Access Service from an application : Externalized output data
  
Externalized output data
An application can populate a request model itself, and then have data returned by the request mapped into a toolkit context. To use the LDAP Access Service with externalized output data, do the following:
1 Obtain a request model.
2 Populate the request model with data.
3 Obtain a context into which the response data will be mapped.
4 Obtain a format to use in mapping the data.
5 Initialize the service.
6 Carry out the request
The code is as follows:
LDAPLookupRequest request=new LDAPLookupRequest();
request.setName("cn=John Doe,ou=Finance,o=XYZ Corp,c=US");
Context context=(Context) ContextFactory.createContext("lookupContext");
LDAPResponseFormat format=(LDAPResponseFormat) FormatElement.readObject("lookupResFmt");
service.initialize();
service.performRequest(request, context, format);
Go up to
Using the LDAP Access Service from an application