일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
In the Web Services world an asynchonous call means sending a message to a remote service and then wait for it to send the response back to the caller
(a.k.a. callback). Talking in HTTP terms this means two different HTTP connections: one from the client to the service provider and the other from the
provider to the client. As the same client can call several times to
an asynchonous service the incoming callbacks must be correlated with
the invocations.
WS-Addressing [WSA] is the standard used for this correlation. This standard defines a set of SOAP headers needed to achieve
correlation. The most important ones are:
- Invoke | ||
- Callback | ||
Fig. 1 - Asynchonous invocation message interchange | |
Each SOAP stack provides it's own implementation of the asynchonous model and problems may occurr when the client and the provider use different SOAP stack.
This document describes the specific case of invoking a JAX-WS asynchronous service from Oracle BPEL 10.1.3.1. Let's take a look to both models to see the
difference.
In BPEL the asynchonous model is implemented via two Web Services. An asynchronous BPEL service exposes two services in it's WSDL as shown in the following
pictures:
Fig. 2 - BPEL process asynchronous WSDL (request highlighted) | |
Fig. 3 - BPEL process asynchronous WSDL (response highlighted) |
The former is to be implemented by the service itself to receive the invocation. The later is to be implemented by the client in order to receive the
callback.
As you can see in the picture below a JAX-WS asynchonous service does only expose one service. The asynchrony affects only to the implementation and not to
the service description itself. The runtime behaviour is the same as in the BPEL case. The only difference is in the way they service is described.
Fig. 4 - JAX-WS asynchronous WSDL |
The target is to create a WSDL equivalent to the JAX-WS one but adapted to the BPEL style so the runtime behaviours get equal.
As we saw previously as there's only one portType in the JAX-WS WSDL it has to be broken down into two. The output of the original portType has to be removed
from it. The new portType has the original one's output as input as it's going to be used for callback.
Fig. 5 - JAX-WS sample portType tag | |
Fig. 6 - JAX-WS sample portType tag (Modified) |
We have to act the same way with the binding. It has to be broken down into two bindings following the same rules used for the portType. First, the output
must be removed from the original binding. Then a binding has to be created for the callback portType. Again, the ouput from the original one becomes the
input of this one.
Fig. 7 - JAX-WS sample binding tag | |
Fig. 8 - JAX-WS sample binding tag (Modified) | |
Finally, a new service has to created. It has to be associated to the recently created portType and binding. The location needs not to have a existing URL as
the WS-Addresing headers will tell the remote service where to send the callback message.
Fig. 9 - JAX-WS sample service tag | ||
Fig. 10 - JAX-WS sample service tag (Modified) |
There are several addresing headers and all of them are valid. Oracle BPEL PM 10.1.3.1 uses the ones in the
http://schemas.xmlsoap.org/ws/2003/03/addressing namespace. In order to use different addressing headers (E.g. the ones in the
http://www.w3.org/2005/08/addressing namespace) the following has to be done:
Some messages have to be defined to send out the theese addressing headers. One for each header we want to be included.
Fig. 11 - http://www.w3.org/2005/08/addressing messages |
The bindings have also to be modified to indicate the headers we want to be sent and received. Each header declaration points to the correspondent message
from the described above.
Fig. 12 - Bindings including headers |
As, by default, Oracle BPEL PM searchs only for the http://schemas.xmlsoap.org/ws/2003/03/addressing headers for correlation a specific handler has to be
deployed. The code shown here is a header handler. It looks for the addressing header and in case it finds it sets the conversation ID (the attribute used
for correlation) with the header's value.
In order to develop a BPEL header handler the com.collaxa.cube.engine.handlers.IMessageHandler interface has to be implemented. To compile it the Jar files
located at the Oracle BPEL PM library folder have to be in the classpath.
Fig. 13 - http://www.w3.org/2005/08/addressing header handler source code |
To deploy it to the Oracle BPEL PM engine just copy the class (with the required folder structure) to the $BPEL_HOME/system/classes folder. Then, edit the
message-handlers.xml file located at $BPEL_HOME/domains/
inbound-flow tag. After restarting BPEL the handler will start working.
Fig. 14 - Message handler configuration |
Integrating PeopleSoft Integration Broker and Oracle Service Bus (0) | 2009.03.11 |
---|---|
Integrating PeopleSoft HCM with BPA Suite and SOA Suite (0) | 2009.03.11 |
Creating an Account in Siebel Using BPEL and Web Services (0) | 2009.03.11 |
Improving Service Performance with Split-Join (0) | 2009.03.11 |
Oracle jdeveloper 11g Technical Preview 4 --; (0) | 2008.12.04 |
archidream's Blog is powered by Daum