LDAP Binding Component Tutorial ZAZ Consulting November, 2007
A Scenario NMR HTTP SOAP BC LDAP BC BPEL SE LDAP ServerClient
Create BPEL Module ● From Netbeans' File menu, select New Project ● Choose category SOA ● Choose project type BPEL Module ● Click Next
Create BPEL Module ● Enter Project Name, for example, EmployeePhoneSearch ● Enter Project Location ● Click Finish to create the new BPEL module project
Create BPEL Module create HTTP request/reply WSDL ● Expand the newly created project ● Right click on Process Files node ● Select New ● Select WSDL Document
Create BPEL Module create HTTP request/reply WSDL ● Enter File Name, for example, HTTPRequestReply ● Click Next
Create BPEL Module create HTTP request/reply WSDL ● Enter Input Message Part Name: EmployeeName ● Enter Output Message Part Name: PhoneNumber ● Click Next
Create BPEL Module create HTTP request/reply WSDL ● Click Finish
Create BPEL Module create LDAP Search WSDL ● Expand the newly created project ● Right click on Process Files node ● Select New ● Select Other
Create BPEL Module create LDAP Search WSDL ● Select category SOA ● Select File Type WSDL From LDAP Server... ● Click Next
Create BPEL Module create LDAP Search WSDL ● Enter LDAP Server URL, for example, ldap://localhost:43418ldap://localhost:43418 ● Click Next
Create BPEL Module create LDAP Search WSDL ● From LDAP object class list, click on inetOrgPerson ● Click “>” to select inetOrgPerson ● Click Next
Create BPEL Module create LDAP Search WSDL ● In Search Filter area on Search tab, highlight uid from the list ● Click on “>” to select uid ● In Result Set area on Search tab, highligh homePhone from the list ● Click on “>” to select homePhone ● Click Finish
Create BPEL Module create BPEL Process ● Generated files should look like this:
Create BPEL Module create BPEL process ● Generated files should look like this:
Create BPEL Module create BPEL process ● Expand the newly created project ● Right click on Process Files node ● Select New ● Select BPEL Process...
Create BPEL Module create BPEL process ● Enter File Name ● Click Finish
Create BPEL Module create BPEL process ● Drag InetOrgPersonSearch.wsdl onto BPEL editor canvas
Create BPEL Module create BPEL process ● Enter Name: PartnerLinkLDAPSearch ● Click Swap Roles, the role should be “Partner Role” ● Click OK
Create BPEL Module create BPEL process ● Drag HTTPRequestReply.wsdl onto BPEL editor canvas
Create BPEL Module create BPEL process ● Enter Name: PartnerLinkHTTPRequest ● Leave role as “My Role” ● Click OK
Create BPEL Module create BPEL process ● Drag Receive activity from Palette to targeted area on BPEL editor's canvas
Create BPEL Module create BPEL process ● Double click on activity Receive1 ● Select PartnerLinkHTTPRequest as Partner Link ● Select HTTPRequestReplyOperation as Operation ● For Input Variable, click on Create ● Click OK
Create BPEL Module create BPEL process ● Drag Invoke activity onto canvas as the next activity after Receive1
Create BPEL Module create BPEL process ● Double click on activity Invoke1 ● Select PartnerLinkLDAPSearch as Partner Link ● Select InetOrgPersonSearchOperation as Operation ● For Input Variable, click Create ● Click OK ● For Output Variable, click Create ● Click OK
Create BPEL Module create BPEL process ● Drag Reply activity from Palette onto canvas, after Invoke 1
Create BPEL Module create BPEL process ● Double click on activity Reply1 ● Select PartnerLinkHTTPRequest as Partner Link ● Select HTTPRequestReplyOperation as Operation ● For Output Variable, click Create ● Click OK
Create BPEL Module create BPEL process ● Drag Assign Activity onto canvas as the next activity after Receive1
Create BPEL Module create BPEL process ● Stay focus on Assign1 activity ● From mapper editor at the bottom, expand highlighted nodes on both sides ● Drag EmployeeName from left side to Value under uid on right side ● Choose String Literal from String icon ● Enter “ou=People,dc=zaz,dc=com” (should match your LDAP server setup) ● Drag the newly created string value to dn ● Create another string literal “=” ● Drag String literal “=” to op under uid on right side
Create BPEL Module create BPEL process ● Stay focus on activity Assign1, the mapping should look like this
Create BPEL Module create BPEL process ● Drag Assign activity onto BPEL canvas, after activity Invoke1
Create BPEL Module create BPEL process ● On Mapper editor, expand InetOrgPersonSearchOperationOut node ● From Nodes icon, select Count ● Drag homePhone from left side to node-set on Count operator ● Drag return number to Result on right side ● Finished mapping should look like this ● The condition of If check is completed
Create BPEL Module create BPEL process ● Drag Assign activity from Palette onto canvas, on the true path of If activity
Create BPEL Module create BPEL process ● For activity Assign2, create following map
Create BPEL Module create BPEL process ● Drag Assign activity from Palette onto canvas, on the false path of If activity
Create BPEL Module create BPEL process ● For activity Assign3, create following map
Create BPEL Module build BPEL module ● Righ click on project name, select Clean and Build
Create Composite Application ● From Netbeans' File Menu, select New Project ● Choose Category SOA ● Choose Project type Composite Application ● Click Next
Create Composite Application ● Enter Project Name, for example, MyPhoneLookupApp ● Click Finish
Create Composite Application ● Right click on newly created composite application project, select Add JBI Module
Create Composite Application ● From Select Project dialog, high light the new bpel module project ● Click Add Project JAR Files
Create Composite Application ● Right click composite application project, and select “Clean and Build”
Create Composite Application ● Right click composite application project, and select “Edit Application Configuration”
Create Composite Application ● CASA editor looks like this
Create Composite Application ● Right click composite application project node, select “Deploy” ● This will start GlassFish application server, if the server hasn't started ● Please make sure httpsoap bc, ldapbc, and bpel se are started
LDAP Server Configuration ● Sun ONE Directory Server 5.2 ● Sample entry
Test Composite Application ● Right click Test node under composite application project node ● Select New Test Case ● Click Next ● Select HTTPRequestReply.wsdl ● Click Next
Test Composite Application ● Select HTTPRequestReplyOperation ● Click Finish
Test Composite Application ● Enter EmployeeName in XML document
Test Composite Application ● Right Click Test Case1 node under composite application project node -> Test node ● Select Run to execute the test ● A phone number should be returned
Test Composite Application ● Create another test case ● Use non-existing employee name, “Not Found” should be returned as result