The OID_LDAPBC.zip file includes four examples of using Oracle Internet Directory with the LDAP Binding Component. Each example includes a BPEL project and a Composite Application project based on the corresponding BPEL projects. These projects provide examples of adding, deleting, updating, and searching LDAP entries.
The projects are located in subfolders in the ZIP file, which are named by the LDAP function they perform, such as Add, Delete, Search, and Update. The ZIP file includes the following projects:
For information about working with the LDAP Binding Component, see the LDAP Binding Component User's Guide. For information about working with Oracle Internet Directory, see the Oracle Internet Directory Administrator's Guide on the Oracle Technology Network (OTN).
This file is also available from the Java CAPS sample code site under the LDAP tab.
Extract the downloaded file into the location where you keep your NetBeans projects.
Right-click in the Projects window, and then select Open Project.
Navigate to the location where you extracted the projects, and then navigate to the subfolder containing the projects you want to work with.
Select the two projects in the subfolder and then click Open Project.
The projects appear in the Projects window. If there are unresolved references, follow the instructions provided by NetBeans to resolve them.
Configure the projects as described below.
In the NetBeans projects window, expand the BPEL project (OIDLdapFunction) and its Process Files folder.
Open the LDAP WSDL document.
This document is named by the LDAP function of the project, such as OIDLdapAddWSDL.wsdl or LdapDeleteWSDL.wsdl.
Note: Each project also includes a second WSDL document, TriggerWSLD.wsdl, for the SOAP binding. This WSDL document does not need to be modified.
Do one of the following:
With the WSDL Editor in WSDL mode, expand Services and its entries until you see ldap:address. Select ldap:address.
With the WSDL Editor in Source mode, scroll to the ldap:address element near the bottom of the file.
Enter the values for the LDAP address attributes based on your Oracle Internet Directory server configuration.
For more information about these attributes, see the LDAP Binding Component documentation.
Save and close the file.
Open the XSD file for the LDAP WSDL document.
These file names are similar to the WSDL document you modified above and include the function name. For example, OIDLdapAddWSDLAdd.xsd or LdapDeleteWSDLDelete.xsd.
Scroll or navigate to the RequestPropertyType element, and modify the element named dn to match your Oracle Internet Directory settings.
The DN is the distinguished name of the directory that contains information about LDAP users; for example, cn=People,dc=oracle,dc=com.
Save and close the file.
Make sure you have saved all changes to the BPEL project.
Right-click the BPEL Project and select Clean and Build.
If it is not already running, start the GlassFish server.
Open the Composite Application service assembly, and click Build. After a successful build, click Deploy.
You might need to set the target server. If this is the case, an error message appears and allows you to select the GlassFish instance to deploy to.
Make sure the GlassFish server and all required JBI components are started. The JBI components include the BPEL Service Engine, HTTP Binding Component, and LDAP Binding Component. You can start them from the Services window in NetBeans. Also make sure your LDAP server is running.
Expand the CASA project you just deployed.
Expand Test, right-click TestCase1, and select Run.
The test case should return a result of success if it was able to connect to the LDAP server properly.
To run the test with a different value, open the Input file and change the value of the input element. Rerun the test.
Tip: If you run into failures when running the test case for adding an entry, verify that your LDAP directory includes the attribute person.description. If it does not include the attribute, remove the entry for person.description from the XSD file and remove the mapping to that property from the second Assign activity. Then rebuild and redeploy the projects.