Runtime components : Service components : LDAP Access Service : Tasks : Using the LDAP Access Service from an application : Externalized input and output data
  
Externalized input and output data
Data for carrying out requests is defined in the toolkit context definition file, and is converted for use with toolkit formatters that are defined in the toolkit formats definition file. To use the LDAP Access Service with externalized data, do the following:
1 Obtain the context that contains the data definitions.
2 Obtain the request format.
3 Obtain the response format.
4 Initialize the service.
5 Carry out the request.
The code is as follows:
Context context=(Context) ContextFactory.createContext("lookupContext");
LDAPRequestFormat reqFmt=(LDAPRequestFormat) FormatElement.readObject("lookupReqFmt");
LDAPResponseFormat resFmt=(LDAPResponseFormat) FormatElement.readObject("lookupResFmt");
service.initialize();
service.execute(context, reqFmt, resFmt);
Go up to
Using the LDAP Access Service from an application