Sunteți pe pagina 1din 4

How to Manipulate SOAP Headers in BPEL

Now Web Services are the De facto standard to implement SOA for any organization. Web
Services are self contained, self descriptive and open standard based. Everyone who is
implementing web services needs to follow the same standards. W3C, OASIS, and WS-I
standardizes these open standards. These standard can be applied to a new service as well as
an existing service and it is the beauty of these standards. WS-* standards are based on the
SOAP headers so you don't need to touch the web service implementation. To support these
standards the BPEL specification implementation should have inbuilt capabilities to manipulate
SOAP headers.

If we talk about Oracle BPEL Process Manager (Oracle's implementation of BPEL specification) it
is having SOAP header manipulation capabilities through BPEL extensions. You can send or
receive SOAP headers from a BPEL process using bpelx:inputHeaderVariable,
bpelx:headerVariable extensions.

To send SOAP headers from the BPEL process you need to use bpelx:inputHeaderVariable
extension in the invoke activity, just give a comma separated list of all the variables you want
to send in the SOAP header. To receive SOAP headers you need to use bpelx:headerVariable
extension in the receive activity. Once you add these extensions in the receive or invoke
activity your part is over and the BPEL Process Manager will add your variables to SOAP header
if you are invoking a web service or extract SOAP headers if you are using receive activity and
assign SOAP headers to the specified variables.

Sending or receiving SOAP headers from Oracle BPEL is very simple, you need to create
messages inside WSDL, variables in BPEL process and then need to use
bpelx:inputHeaderVariable and bpelx:headerVariable extensions. See the following to
understand how to add bpelx:inputHeaderVariable and bpelx:headerVariable into the invoke,
receive, onMessage and reply activities respectively:

<receive name="receiveInput" partnerLink="client" portType="client:TestProcess"


operation="process" variable="inputVariable" createInstance="yes"
bpelx:headerVariable="yourVariable1, yourVariable2"/>

<invoke name="Invoke_1" partnerLink="NestedSchemaTest"


portType="ns1:NestedSchemaTest" operation="process"
inputVariable="Invoke_1_process_InputVariable"
outputVariable="Invoke_1_process_OutputVariable" bpelx:inputHeaderVariable="yourVariable1,
yourVariable2 .." bpelx:outputHeaderVariable="yourVariable1, yourVariable2 ..."/>

If you are invoking an asynchronous process then don't use bpelx:outputHeaderVariable


extension.

<onMessage bpelx:headerVariable="variable_1 variable_2 ..." />


<reply bpelx:headerVariable="variable_1 variable_2..." />

Deploy your BPEL process and use TCP protocol monitor or obtunnel to see the SOAP headers in
the SOAP envelop. Don't forget to set the "optSoapShortcut" property to "false" otherwise you
wont be able to see the SOAP headers in obtunnel or TCP monitor. From oracle 10.1.3.1 this
property is not available on the BPEL control so you need to add it in the <BPEL
Home>/domains/<domain>/config/domain.xml as given below:
<property id="optSoapShortcut">
<name>Optimize SOAP invocations.</name>
<value>false</value>
<comment></comment>
</property>

Posted by Sam at 11:33 AM


Labels: Oracle BPEL, SOAP Header

3 comments:

Dibya Prakash said...

Hi Dharmendra

Your post is relly gud. I need some help from you.


I am currently facing difficulties in calling an External Webservice from my
BPEL Process and passing SOAP Message to it. The details are below:
1. The BPEL process, using database polling feature of DB Adapter, will get
the records from the database.

2. Transform the message

3. Call the External Webservice and pass the transformed message as the
input to it. However the Webservice expects the BPEL process to send SOAP
headers in the input message.

I am struggling on how to put the transformed message within a SOAP


envelope in the BPEL process.

Can you please guide me.

Thanks In Advance

Regards,
Dibya
October 24, 2008 2:12 PM

Nitin said...

Hi Dharam Sir,

I have created one routing service as one sample application that


demonstrates "header based routing", in which our routing service expects
header data for filtering.
My issue is, how to send header data, while invoking this routing service
through BPEL process?

Thanx In Advance
Nitin
November 6, 2008 1:13 AM
Hari said...

I'm getting an error in the "Create Partner Link" dialogue when specifying an
https-based wsdl url. The non-ssl wsdl url works fine, but I need it to work for
ssl (https). The specific errror reads:

Error:Failed to read wsdl file at "https://serverstuff/webservice.cfc?wsdl",


caused by: javax.net.ssl.SSLHandshakeException.
:sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target

What do I need to do to get the https wsdl to validate? I'm using jDev
10.1.3.2. When I deploy the BPEL, will I need to do anything on the app
server? I've seen a lot of similar questions on this forum with no definitive
answers. Also, the BPEL dev guide does not address SSL.
December 16, 2008 3:47 AM

S-ar putea să vă placă și