search

This function returns a list of LDAP entries.

Signature:

ldap:search('directoryName','filter','scope')

Parameters:

  • directoryName: The directory name specified in the directories.xml file. For information about the directories.xml file, see authenticate.

  • filter: The filter expression to use for the search; this value cannot be null.

  • scope: The scope of the search. It must be one of the following values: 1: one level, 2: subtree, or 0: named object. This parameter is optional. By default, its value is 2.

Returns:

An XML element that contains the list of entries.For this XPath function, all properties must be specified in the directories.xml file.

Example

ldap:search('people','cn=weblogic');

The following provides an example of the output:

 <searchResult xmlns="http://schemas.oracle.com/bpel/ldap">
   <searchResultEntry dn="uid=weblogic" xmlns="urn:oasis:names:tc:DSML:2:0:core">
      <attr name="uid">
         <value>weblogic</value>
      </attr>
      <attr name="userpassword">
         <value>
Unknown macro: {ssha}
 
bHDVJRfWVt/Uwlzb4TKU+QTOLB4FLySO</value>
 
      </attr>
 
      <attr name="objectclass">
         <value>inetOrgPerson</value>
         <value>organizationalPerson</value>
         <value>person</value>
         <value>top</value>
         <value>wlsUser</value>
      </attr>
      <attr name="description">
         <value>This user is the default administrator.</value>
      </attr>
      <attr name="wlsMemberOf">
         <value>cn=Administrators,ou=groups,ou=myrealm,dc=soainfra</value>
      </attr>
      <attr name="orclguid">
         <value>8AC1B6206FDD11DEBF9A7F3D47003274</value>
      </attr>
      <attr name="sn">
         <value>weblogic</value>
      </attr>
      <attr name="cn">
         <value>weblogic</value>
      </attr>
   </searchResultEntry>
   <searchResultEntry xmlns="urn:oasis:names:tc:DSML:2:0:core"/>
</searchResult>