About this task
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:
- Obtain the context that contains the data definitions.
- Obtain the request format.
- Obtain the response format.
- Initialize the service.
- 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);