The VaToolBxJavaLDAPSearch function lets you connect to an LDAP server in order to conduct a search according to a given context, from a search filter, with the required search depth (level 1 or as far as sheets). Only the desired attributes of the results are returned. The parameters required for connection to the LDAP server are: the host name, user, password, LDAP server version.
Prerequisites: the file jndi.jar must be present in the execution context.
This file is included in Tomcat 4.1. With WebSphere 5, jndi.jar's classes are included in server.jar.
Context
Java client,
Java server,
Adelia Web client,
Adelia Cloud client,
Event Adelia client.
Parameters
ALPHA(n) |
Host |
Host name. Optionally, this name can be prefixed with the protocol to be used, i.e. "ldap://" or "ldaps://". Using the "ldaps://" protocol activates the SSL connection handling. Default protocol used: "ldap://". |
NUM_BIN_2 |
Port |
Port number. |
NUM_BIN_2 |
Version |
LDAP protocol version (2 or 3). |
ALPHA(n) |
User |
User name. |
ALPHA(n) |
Password |
User's password. |
ALPHA(n) |
Context |
Search context name (e.g. "O=HARDIS", "OU=ADELIA, O=HARDIS"). |
NUM_BIN_2 |
Level |
Search level: 1 (OBJECT_SCOPE) or 2 (SUBTREE_SCOPE). |
ALPHA(n) |
Filter |
Search filter (e.g. "objectClass=inetOrgPerson"). |
ALPHA(n) |
Attribute(m) |
Table of attributes to be returned by the search (e.g. "member", "sn" (surname), "cn" (complete name), "givenname" (given name), "uid" (User ID), "dn" (DN distinguished name), "mail" (email address)). |
ALPHA(n) |
Results(m) |
Array of results. |
BOOL |
ReturnCode |
Return code for the operation: *TRUE if the operation was successful. *FALSE if the operation failed. |
Note: The only output parameters are the results table and the return code.
Example
ALPHA(50) |
Host |
NUM_BIN_2 |
Port |
NUM_BIN_2 |
Version |
ALPHA(50) |
User |
ALPHA(50) |
Password |
ALPHA(50) |
Context |
NUM_BIN_2 |
Level |
ALPHA(50) |
Filter |
ALPHA(50) |
Attributes_SEL(2) |
ALPHA(250) |
Results(50) |
BOOL |
ReturnCode |
Host |
= 'srvweb.hardis.com' |
Port |
= 389 |
Version |
= 3 |
User |
= 'JSmith' |
Password |
= 'pwjsmith' |
Context |
= 'O=HARDIS' |
Filter |
= 'objectClass=inetOrgPerson' |
Attributes_SEL(1) |
= 'mail' |
Attributes_SEL(2) |
= 'member' |
CALL_DLL 'VaToolBx' 'VaToolBxJavaLDAPSearch' Host Port Version User Password Context Level Filter Attributes_Sel Results ReturnCode
List of the VaToolBx functions by topic