Dynamic Partner Links in JBI
I've put together an example of using a dynamic partner link in OpenESB. This example shows the basics of assigning an EndpointReference to a partner link at runtime, and then invoking that partner link.
Below is the tutorial I've put together (really just some high level steps). I've also uploaded the tutorial and NetBeans modules I've created here.
Prerequisites:
Tutorial:
- Step 1: Create a New BPEL Module
- Step 2: Create a New SOAP WSDL with one request-response operation, and a simple BPEL process for the backend . We'll invoke this service dynamically later on.
- Step 3: Add an External WSDL File from http://schemas.xmlsoap.org/ws/2004/08/addressing. The WS-Addressing WSDL defines the EndpointReference element that we'll need.
- GOTCHA: NetBeans may add a character to the beginning of the wsdl when it imports. Make sure to remove this character. In some cases, this may be a hidden character that will only show up in an editor like VI.
- GOTCHA: NetBeans may add a character to the beginning of the wsdl when it imports. Make sure to remove this character. In some cases, this may be a hidden character that will only show up in an editor like VI.
- Step 4: Create another SOAP WSDL with one request-response operation. This service will provide the dynamic partner link functionality.
- Add a schema to the wsdl that defines an elment that accepts an EndpointReference and xsd:anyType.
- Modify the request message accordingly
- Add a schema to the wsdl that defines an elment that accepts an EndpointReference and xsd:anyType.
- Step 5: Create another BPEL Process. This process should assign the EndpointReference to a PartnerLink and invoke it.
- Step 6: Clean and Build the BPEL Module.
- Step 7: Create a Composite Application and add your BPEL Module to it.
- Step 8: Clean and Build the Composite Application.
- Step 9: Correct the Composite Application's configuration using the CASA Editor.
- Step 10: Clean, Build, and Deploy the Composite Application Again
- Step 11: Create a test case to invoke the service we created in step 2.
- Step 12: Create another service to invoke, just as in Step 2. Make the BPEL process do something a little different so we will be able to tell which service was invoked.
- This WSDL must have the same target namespace and operation to invoke as the WSDL in step 2.
- This WSDL must have the same target namespace and operation to invoke as the WSDL in step 2.
- Step 13: Create a second test case to invoke the new service you've created.