Java CAPS Sample Documentation


<font color="red">Working with the Oracle Java CAPS Samples for the LDAP Binding Component and Oracle Internet Directory</font>

Working with the Oracle Java CAPS Samples for the LDAP Binding Component and Oracle Internet Directory


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).

Installing the Sample Projects

  1. Download OID_LDAPBC.zip.

    This file is also available from the Java CAPS sample code site under the LDAP tab.

  2. Extract the downloaded file into the location where you keep your NetBeans projects.

  3. Launch NetBeans.

  4. Right-click in the Projects window, and then select Open Project.

  5. Navigate to the location where you extracted the projects, and then navigate to the subfolder containing the projects you want to work with.

  6. 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.

  7. Configure the projects as described below.


Configuring the Sample Projects

  1. In the NetBeans projects window, expand the BPEL project (OIDLdapFunction) and its Process Files folder.

  2. 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.

  3. 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.

  4. 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.

  5. Save and close the file.

  6. 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.

  7. 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.

  8. Save and close the file.


Deploying the Projects

  1. Make sure you have saved all changes to the BPEL project.

  2. Right-click the BPEL Project and select Clean and Build.

  3. If it is not already running, start the GlassFish server.

  4. 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.


Testing the Projects

Before You Begin:

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.

  1. Expand the CASA project you just deployed.

  2. 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.

  3. 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.