8. Testing an LDAP-Based Operation This page last changed on Jan 01, 2009. ## How To Test an LDAP-based Operation This topic describes how to create a logical data service and add an operation to test a Java-based read operation in the physical data service. #### Topic Map How To Test an LDAP-based Operation Create a New Logical Data Service Creating a Read Operation Defining the Read Operation Testing the Java-Based Read Operation Related Topics Supporting LDAP Server Entries Through Data Services ### Create a New Logical Data Service The first step is to create a new logical data service that will serve as the container for the operation. Expand RetailDataspace/Logical, right-click Customer, and choose New > Logical Data Service. Choosing New > Logical Data Service Enter LdapTest as the data service name. New Logical Data Service Dialog Click Browse to select a schema file, expand `Logical/Customer/schemas`, select `Profile.xsd`, and click OK. New Dataspace Project Dialog Click Finish. Workshop for WebLogic creates the new logical data service. ### Creating a Read Operation After creating the logical data service, you need to add a read operation that uses the Java-based read operation in the physical data service. In the Overview for the `LDAPTest.ds` data service, right-click and choose Add Operation. Adding a New Operation Type a name for the new operation, such as `getLdapCustomers.` Click OK. Adding a New Operation Dialog Choose File > Save to save the data service. ### Defining the Read Operation The next step is to define the `getLdapCustomers` read operation to join information returned by the `getAllPersons` Java-based operation and the `getCustomer` operation in the `Profile` data service. Click the Query Map tab in the `LdapTest.ds` data service. Expand `RetailDataspace/Physical/LDapdsp.ds`, drag the `getAllPersons()` operation, and drop it in the Query Map. Adding the getAllPersons Operation Expand `RetailDataspace/Logical/Customer/Profile.ds`, drag the `getCustomer` operation, and drop it in the Query Map. Adding the getCustomer Operation Create a connection between the `userId` element in the `getAllPersons()` operation and the `LoginID` element in the `getCustomer` operation by dragging the userId element to the target element. Joining the userId and LoginID Click the Overwrite Mapping button, and drag the `PROFILE` complex element name in the `getCustomer` operation `to the PROFILE` element in the Return type. Overwrite Mapping the Porfile to the Return Results Right-click `PROFILE` in the `Return` result and choose Expand Complex Mapping. Expanding Complex Mapping Click the Source tab. Change the `FirstName` element of the result to the following:
       {fn:concat('LDAP',fn:data($inetOrgPerson/commonName))}
Choose File > Save to save the data service. ### Testing the Java-Based Read Operation The final step is to run the `getLdapCustomers()` read operation, which uses the Java-based `getAllPersons()` read operation in the physical data service. To test the `getLdapCustomers()` read operation: With the `LdapTest.ds` open, click the Test tab. Choose `getLdapCustomers()` from the Select operation drop-down list. Click Run. Workshop for WebLogic runs the operation and displays the results. Running the `getLdapCustomers` Operation ### Related Topics ##### Concepts Supporting LDAP Server Entries Through Data Services ##### How Tos Building a Java LDAP Application Creating the Physical Data Service for the LDAP Sample Create a Physical Data Service from a Java Function (general description)

Document generated by Confluence on Jan 13, 2009 15:16