![]() ![]() ![]() ![]() ![]() ![]() |
This document describes how to bring Oracle BPEL Process Manager into your service oriented architecture (SOA) environment using Oracle Service Bus. It contains the following sections:
Before you begin building services in Oracle Service Bus that work with Oracle BPEL Process Manager, be sure to review the Product Support Information to make sure you are using the supported configurations for BPEL interoperability.
Oracle Service Bus provides support for communication with Oracle BPEL Process Manager, letting you include BPEL processes in your service oriented architecture (SOA). With Oracle Service Bus’s native transport for Oracle BPEL Process Manager (BPEL transport), you can expose BPEL processes as Web services in the service bus layer, letting other services invoke BPEL processes.
Likewise, Oracle BPEL Process Manager can call services in the service bus layer for use in its own processes.
While this guide focuses on built-in integration between Oracle Service Bus and Oracle BPEL Process Manager—integration enabled at the Oracle Service Bus API level, you are not limited to only the solutions provided in this guide. You may also use other standard communication protocols provided with Oracle Service Bus, such as HTTP, JMS, and File.
For detailed information on Oracle BPEL Process Manager, go to http://www.oracle.com/technology/products/ias/bpel/index.html.
Communication between Oracle BPEL Process Manager and Oracle Service Bus is done over SOAP only.
Oracle Service Bus and Oracle BPEL Process Manager do not provide full support for SOAP RPC encoding. The BPEL transport accepts SOAP RPC encoding bindings, but some encoding mechanisms, such as multiRef, may cause run time failures.
The BPEL transport supports the following features:
The BPEL transport has the following restrictions:
Oracle BPEL Process Manager supports transaction propagation through its API, and the BPEL transport is transactional to support transaction propagation when Oracle BPEL Process Manager is deployed on WebLogic Server. For example, if a process begins in a service outside of Oracle BPEL Process Manager, Oracle Service Bus can propagate the transaction to Oracle BPEL Process Manager through the BPEL transport to complete the transaction.
Transaction propagation is also supported from BPEL Process Manager to Oracle Service Bus through an SB transport-based proxy service.
Note: | Transaction propagation is not yet supported for Oracle servers OC4J and Oracle AS and not yet certified on IBM WebSphere. |
Because calls from Oracle Service Bus to Oracle BPEL Process Manager are made using RMI, the BPEL transport supports security at the call level through one-way SSL. For more information, see the Endpoint URI section.
The BPEL transport declares the following environment values, which can be maintained when moving an Oracle Service Bus configuration among different deployment environments:
This section describes the simple, most common use cases for communicating to and from Oracle BPEL Process Manager through Oracle Service Bus: synchronous one-way or request/response communication.
Figure 1 illustrates a synchronous communication pattern between a client and Oracle BPEL Process Manager through Oracle Service Bus.
Use the following guidelines to invoke Oracle BPEL Process Manager processes from a client:
To ensure that messages are associated with the correct conversation, see Associating Messages with the Correct Conversation.
Figure 2 illustrates a synchronous communication pattern between Oracle BPEL Process Manager and a service provider through Oracle Service Bus.
Use the following guidelines to invoke an external service from Oracle BPEL Process Manager:
See one of the following topics for proxy configuration details:
To ensure that messages are associated with the correct conversation, see Associating Messages with the Correct Conversation.
When using stateful services, the messages sent synchronously between Oracle Service Bus and Oracle BPEL Process Manager are known as a conversation. Oracle BPEL Process Manager supports the following mechanisms for ensuring that messages are correctly associated with each other as part of a conversation. These mechanisms are independent of each other, and you may choose to use both to ensure correct association.
For more information on WS-Addressing, see the MessageID / RelatesTo section in the WS-Addressing reference. For an example of conversation ID setting, see the Conversation ID Examples.
This section describes more advanced use cases for communicating to and from Oracle BPEL Process Manager through Oracle Service Bus using asynchronous communication.
Figure 3 illustrates an asynchronous communication pattern between Oracle BPEL Process Manager and a service provider through Oracle Service Bus.
In an asynchronous message exchange, a callback is sent on a different connection than the request.
Use the following guidelines to invoke Oracle BPEL Process Manager processes asynchronously from a client through Oracle Service Bus:
As part of the business service configuration, you select a Callback Proxy. At run time, the BPEL transport uses this proxy as the callback proxy.
For approaches to setting a callback address if you do not select a callback proxy in the business service, see the WS-Addressing Reference and the Asynchronous BPEL to BPEL Through Oracle Service Bus Example.
If you select this proxy service as the business service’s callback proxy, the BPEL transport provides the correct callback URI at run time.
See one of the following topics for proxy configuration details:
Configure the business process you need to handle the callback.
See the Transport Configuration Reference. See also the Business Service Transport Configuration page reference for configuration information not covered in this document.
This section describes the steps and configuration needed for Oracle BPEL Process Manager to make service calls through Oracle Service Bus.
Figure 4 illustrates an asynchronous communication pattern between Oracle BPEL Process Manager and a service provider through Oracle Service Bus.
In an asynchronous message exchange, a callback is sent on a different connection than the request.
Use the following guidelines to invoke an external service asynchronously from Oracle BPEL Process Manager through Oracle Service Bus.
For information on setting a callback address, see the ReplyTo section of the WS-Addressing reference and the Asynchronous BPEL to BPEL Through Oracle Service Bus Example.
See one of the following topics for proxy configuration details:
Create a WSDL-based business service. Generate the WSDL from Oracle BPEL Process Manager. Select a Service Type of WSDL Web Service, and select the appropriate binding or port in the WSDL
Note: | If the callback address is always known, for example when the client and BPEL service are linked together because of a trading partner agreement, you can provide the exact callback address in the callback business service instead of using bpel://callback. |
Configure the remainder of the business service. See the Transport Configuration Reference. See also the Business Service Transport Configuration page reference for configuration information not covered in this document.
This section provides descriptions for BPEL transport-specific configuration options. For descriptions of other business service configuration options, see one of the following topics:
Table 1 describes the URI format for the BPEL transport, which you configure on the main Transport page of the business service in either Workshop for WebLogic or in the Oracle Service Bus console.
For the following endpoint URI format, optional elements are shown in square brackets. Descriptions follow.
Use one of the following RMI / JNDI protocols: |
|
If the callback address is always known, for example when the client and BPEL service are linked together because of a trading partner agreement, you can provide the exact callback address for the Endpoint URI instead of using bpel://callback.
See the description of the Service Callback role in Table 2.
|
Table 2 describes the options available on the BPEL transport configuration page in either Workshop for WebLogic or in the Oracle Service Bus console.
The BPEL transport is used to send request messages from Oracle Service Bus to Oracle BPEL Process Manager. The business service can serve one of the following roles:
A Service Callback business service does not support load balancing or failover. For instructions on using Service Callback, see “Service Callback” in Table 1 and Asynchronous: Calling Service Providers from Oracle BPEL Process Manager. |
|
This optional field is available only for the Asynchronous Client role. This field lets you select the proxy service (must be either an SB or HTTP proxy of type WSDL SOAP or Any SOAP) that will be used to route callbacks to the Oracle Service Bus client that made the request. For more information, see the guidelines in Advanced Use Cases (Asynchronous).
|
|
Selecting Suspend Transaction makes the business service non-transactional even if the business service is invoked by a transaction.
For a description of transaction propagation, see Transaction Propagation.
|
|
Select the instance of WebLogic Server Work Manager that you want to use for the dispatch policy for this endpoint. The default Work Manager is used if no other Work Manager exists.
For information about Work Managers, see the following WebLogic Server Administration Console Online Help topics:
|
Security in Oracle BPEL Process Manager is handled at the EJB level.
The BPEL transport supports a JNDI “Service Account” option used for the creation of the JNDI context and the EJB lookup, as described in Table 2. The BPEL transport gets the user name and password. If the service account is not configured, an anonymous subject is assumed.
The BPEL transport also supports security at the call level by letting you indicate one-way SSL in the protocol portion of the URI from Oracle Service Bus to Oracle BPEL Process Manager. For more information, see the Endpoint URI section.
To use SSL from Oracle Service Bus to OC4J and Oracle AS servers (using the ormis and opmns protocols), you must configure SSL on your Oracle Service Bus server by adding the following properties to your domain’s setDomainEnv script:
-Djavax.net.ssl.trustStorePassword=passphrase
-Djavax.net.ssl.trustStore=<file path to a keystore of trust certificate>
The BPEL transport handles Oracle BPEL Process Manager exceptions in different ways.
If a BPEL process replies with a fault, the BPEL transport intercepts the fault message at the API and translates it into a SOAP fault.
The transport’s automated application error-handling functionality lets you decide whether or not to automatically retry application errors—in this case BPEL faults—when they occur. For example, you may determine that application errors will always fail until the problem is fixed. Use the Retry Application Errors option on the transport configuration page to turn application retries on and off.
Oracle BPEL Process Manager can throw the following non-fault exceptions, which the BPEL transport automatically categorizes as TransportException connection errors:
The transport’s automated connection error-handling functionality lets you determine if and how often connection errors are retried. Use the Retry Count and the Retry Iteration Interval options on the transport configuration page to control the number of retries and the number of seconds to wait between retries on connection errors. Setting Retry Iteration Interval to zero (0) means connection errors are not retried.
Other non-application and non-connection exceptions are re-thrown as a generic TransportException error.
This section describes specific WS-Addressing properties that the BPEL transport uses to communicate with Oracle BPEL Process Manager. This section also describes ways to provide callback addresses in asynchronous communication, as described in the Advanced Use Cases (Asynchronous) guidelines.
See the XML Examples for WS-Addressing examples.
In asynchronous communication, a service callback is sent on a different connection than the request. As a service developer, you must supply the correct callback address in an asynchronous exchange so that the callback is sent to the correct client.
The BPEL transport provides a built-in mechanism for providing the correct callback address. When you create a BPEL business service in Oracle Service Bus, you can select a Callback Proxy to handle the callback, and the BPEL transport automatically sets the correct callback address. You do not need to manually use “ReplyTo.”
For more information, see Asynchronous: Invoking Processes in Oracle BPEL Process Manager
When calling an external service from Oracle BPEL Process Manager through Oracle Service Bus, you must manually set a callback address. To do this using WS-Addressing, in the request proxy service set the callback address as the “ReplyTo” value. The BPEL transport in the business service uses that URI as the callback address.
For more information, see Asynchronous: Calling Service Providers from Oracle BPEL Process Manager.
“MessageID” and “RelatesTo” are used to store the conversation ID in conversations between Oracle Service Bus and Oracle BPEL Process Manager, making sure related messages remain in the same conversation.
The BPEL transport does not let you specify whether a given operation is a start or continue operation. Instead, the BPEL transport looks for the “MessageID” and “RelatesTo” properties and sets them accordingly.
The following describes how the BPEL transport uses “MessageID” and “RelatesTo” in synchronous and asynchronous conversations:
If there is no value assigned to “MessageID” or “RelatesTo,” the transport assumes either no conversation is occurring or that Oracle BPEL Process Manager is handling the correlation.
If there is no value assigned to “MessageID” or “RelatesTo,” the transport assumes either no conversation is occurring or that Oracle BPEL Process Manager is handling the correlation.
For more implementation on establishing a conversation ID to make sure messages participate in the correct conversation, see Associating Messages with the Correct Conversation and the Conversation ID Examples.
Following are examples of XML messaging issues between Oracle Service Bus and Oracle BPEL Process Manager.
This section provides different examples of establishing a conversation ID among messages in a conversation between Oracle Service Bus and Oracle BPEL Process Manager.
In Figure 5, a client is synchronously invoking a process in Oracle BPEL Process Manager. The business service (B1) uses the BPEL transport to invoke a process. The proxy service (P1) handles any necessary conversation ID mapping.
The examples in this section use the following port and message definitions defined in the WSDL.
<wsdl:types>
<xsd:schema
targetNamespace="http://www.sample.org/spec/samples/types"
elementFormDefault="qualified">
<xsd:complexType name="ValueHolder">
<xsd:all>
<xsd:any minOccurs="1"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<message name="create"/>
<message name="putRequest">
<part name="key" type="xsd:string"/>
<part name="value" type="types:ValueHolder"/>
</message>
<message name="putResponse">
<part name="value" type="types:ValueHolder"/>
</message>
...
<message name="dispose"/>
<portType name="ServiceMap">
<operation name="create">
<input message="tns:create"/>
</operation>
<operation name="put">
<input message="tns:putRequest"/>
<output message="tns:putResponse"/>
</operation>
...
<operation name="dispose">
<input message="tns:dispose"/>
</operation>
</portType>
This example shows how WS-Addressing is used to set the conversation ID among messages in a conversation.
Figure 5 shows communication pattern.
<soap:Envelope>
<soap:Header>
<wsa03:MessageID>uuid:123456789</wsa03:MessageID>
</soap:Header>
<soap:Body>
<create/>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Header>
<wsa03:MessageID>uuid:111111111</wsa03:MessageID>
<wsa03:RelatesTo>uuid:123456789</wsa03:RelatesTo>
</soap:Header>
<soap:Body>
<put>
<key>key</key>
<value>
<PO/>
</value>
</put>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Body>
<putResponse>
<value/>
</putResponse>
</soap:Body>
</soap:Envelope>
The <put> operation also has a MessageID, but it is ignored because the RelatesTo has a value that provides the conversation ID.
This example shows how message payload data can be used to set the conversation ID among messages in a conversation.
In these examples, the proxy service maps the ID to the MessageID / RelatesTo SOAP headers.
Figure 5 shows communication pattern.
<soap:Envelope>
<soap:Body>
<create/>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Body>
<createResponse>
<mapID>uuid:123456789</mapID>
</createResponse>
</soap:Body>
</soap:Envelope>
Proxy service to BPEL process (via a business service)
<soap:Envelope>
<soap:Header>
<wsa03:MessageID>uuid:123456789</wsa03:MessageID>
</soap:Header>
<soap:Body>
<create/>
</soap:Body>
</soap:Envelope>
Not shown: The ID was generated in the request of the proxy service pipeline and inserted as a <wsa03:MessageID> before invoking the process. On the process side, the Create operation is one-way, so a SOAP response must be created before replying to the client. The response sends back the ID that was generated by the proxy service.
<soap:Envelope>
<soap:Body>
<put>
<mapID>uuid:123456789</mapID>
<key>key</key>
<value>
<PO/>
</value>
</put>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Body>
<putResponse>
<value/>
</putResponse>
</soap:Body>
</soap:Envelope>
Proxy service to BPEL process (via a business service)
<soap:Envelope>
<soap:Header>
<wsa03:RelatesTo>uuid:123456789</wsa03:RelatesTo>
</soap:Header>
<soap:Body>
<put>
<key>key</key>
<value>
<PO/>
</value>
</put>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Body>
<putResponse>
<value/>
</putResponse>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Body>
<dispose>
<mapID>uuid:123456789</mapID>
</dispose>
</soap:Body>
</soap:Envelope>
Proxy service to BPEL process (via a business service)
<soap:Envelope>
<soap:Header>
<wsa03:RelatesTo>uuid:123456789</wsa03:RelatesTo>
</soap:Header>
<soap:Body>
<dispose/>
</soap:Body>
</soap:Envelope>
In these examples, the client uses a more recent version of the WS-Addressing spec (wsa04 prefix). The proxy service is responsible for transforming the SOAP headers to use the wsa03 prefix. The proxy service developer configures the transformation.
Figure 5 shows communication pattern.
<soap:Envelope>
<soap:Header>
<wsa04:MessageID>uuid:123456789</wsa04:MessageID>
</soap:Header>
<soap:Body>
<create/>
</soap:Body>
</soap:Envelope>
Proxy service to BPEL process (via a business service)
<soap:Envelope>
<soap:Header>
<wsa03:MessageID>uuid:123456789</wsa03:MessageID>
</soap:Header>
<soap:Body>
<create/>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Header>
<wsa04:MessageID>uuid:111111111</wsa04:MessageID>
<wsa04:RelatesTo>uuid:123456789</wsa04:RelatesTo>
</soap:Header>
<soap:Body>
<put>
<key>key</key>
<value>
<PO/>
</value>
</put>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Body>
<putResponse>
<value/>
</putResponse>
</soap:Body>
</soap:Envelope>
Proxy service to BPEL process (via a business service)
<soap:Envelope>
<soap:Header>
<wsa03:MessageID>uuid:111111111</wsa03:MessageID>
<wsa03:RelatesTo>uuid:123456789</wsa03:RelatesTo>
</soap:Header>
<soap:Body>
<put>
<key>key</key>
<value>
<PO/>
</value>
</put>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Body>
<putResponse>
<value/>
</putResponse>
</soap:Body>
</soap:Envelope>
The following example shows the SOAP headers involved in one BPEL process invoking another BPEL process asynchronously through Oracle Service Bus.
In Figure 6, P1 and P2 are proxy services that pass messages (and perform transformations) to B1 and B2 business services, which are required to make calls to BPEL processes using the Oracle Service Bus BPEL transport.
Refer to Figure 6 for the following SOAP header examples.
<message name="LoanServiceRequestMessage">
<part name="payload" element="types:loanApplication"/>
</message>
<message name="LoanServiceResultMessage">
<part name="payload" element="types:loanOffer"/>
</message>
<portType name="LoanService">
<operation name="initiate">
<input message="tns:LoanServiceRequestMessage"/>
</operation>
</portType>
<portType name="LoanServiceCallback">
<operation name="onResult">
<input message="tns:LoanServiceResultMessage"/>
</operation>
</portType>
<soap:Envelope>
<soap:Header>
<wsa03:ReplyTo>
<wsa03:Address> ormi://serverB:7001/default/AmericanLoanClient/1.0/service/LoanServiceRequester
</wsa03:Address>
</wsa03:ReplyTo>
<MessageID>AmericanLoanClient~1.0/60007</MessageID>
</soap:Header>
<soap:Body >
<loanApplication>
...
</loanApplication>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Header>
<wsa03:ReplyTo>
<wsa03:Address>http://serverB:7001/P2</wsa03:Address>
<wsa03:ReferenceProperties>
<osb:Callback>
<osb:Address>
ormi//localhost/default/AmericanLoanClient/1.0/service/LoanServiceRequester
</osb:Address>
</osb:Callback>
</wsa03:ReferenceProperties>
</wsa03:ReplyTo>
<MessageID>AmericanLoanClient~1.0/60007</MessageID>
</soap:Header>
<soap:Body >
<loanApplication>
...
</loanApplication>
</soap:Body>
</soap:Envelope>
The ReplyTo callback address is set by B1, which gets the value from the Callback Proxy field in the BPEL transport configuration, as described in Table 2. B1’s callback proxy is P2.
You must wrap the original replyTo information and send it as reference properties so that it is echoed back in the onResult callback message (to follow).
Note: | This sample uses osb:Callback and osb:Address for illustration purpose only. There is no standard or Oracle Service Bus standard elements defined for WS-Addressing support. |
<soap:Envelope>
<soap:Header>
<wsa03:RelatesTo>AmericanLoanClient~1.0/60007</wsa03:RelatesTo>
<osb:Callback>
<osb:Address> ormi//localhost/default/AmericanLoanClient/1.0/service/LoanServiceRequester
</osb:Address>
</osb:Callback>
</soap:Header>
<soap:Body >
<loanOffer>
...
</loanOffer>
</soap:Body>
</soap:Envelope>
The reference property osb:Callback is sent back as a SOAP header by the Oracle BPEL Process Manager engine.
<soap:Envelope>
<soap:Header>
<wsa03:RelatesTo>AmericanLoanClient~1.0/60007</wsa03:RelatesTo>
</soap:Header>
<soap:Body >
<loanOffer>
...
</loanOffer>
</soap:Body>
</soap:Envelope>
Proxy service P2 removes the temporary osb:Callback header; but prior to deleting this header, the replyTo address value is copied to the $outbound variable so that the BPEL transport in business service B2 can send the callback message to the correct BPEL process.
![]() ![]() ![]() |