Sunday, August 16, 2009

Writing a simple WS-BPEL process for WSO2-BPS and Apache ODE


I've written an article on The WSO2 OxygenTank explaining the fundamentals on writing and deploying a simple BPEL which interacts with several partner services, in WSO2 BPS and Apache ODE.
So this article focuses on the basic functionalities such as: how to invoke partner services from a BPEL process, how to wait for a message from a client who invokes a BPEL process etc. A sample BPEL process called "FunctionProcess" is also attached to the article, with required sample partner services. All examples are based on the attached sample code.

The article flows based on the following topics.
  • What is a business process?
  • What's BPEL?
  • Basic terms used in the BPEL terminology
  • How to deploy sample partner services and the BPEL process
  • How to establish a partner link with a Web service
  • How to invoke the BPEL process from a client
  • How to invoke a partner Web service from the BPEL process
  • How to reply to the client from the BPEL process
  • How to do basic variable manipulation in a BPEL process
  • How to Deploy and test the BPEL process

42 comments:

pradeep fernando said...

great work man.... very very useful & nicely written.

Unknown said...

yes nicely written :D

But there is one thing i still dont quite understand.
Why does every service, which is controlled by the BPEL need a partnerlink? That sounds quite senseless to me, since i may or may not be in the position to manipulate someones wsdl file o_O

What if i for example want to use some yahoo webservices - do i have to write wrapper services using the partnerlink in its wsdl?

or am i still completely wrong?

Thanks man!

Unknown said...

@andreowitsch, This link will be helpful. http://ode.apache.org/user-guide.html#UserGuide-HTTPBindingExtensionsforRESTfulservices

Cheers

Anonymous said...


Could you please tell me the step by step process for How can we consuming WSO2 ESB service USING WSO2 BPS(BPEL

Anonymous said...


Could you please tell me the step by step process for How can we consuming WSO2 ESB service USING WSO2 BPS(BPEL

Unknown said...

Hi Anil,
When you create a service (eg - proxy service etc.) WSO2 ESB exposes a WSDL which is used as an interface to the created service. So using that WSDL you can invoke the particular service from WSO2 BPS. You can get some idea on how to do this from

[1] - How to invoke a partner Web service from the BPEL process
[2] - Developing WS-BPEL Processes using WSO2 Carbon Studio
[3] - Developing BPEL processes using WSO2 Carbon Studio - Thursday 17th March 2011

Anonymous said...

Hi Denis,Thank you, and while i am uploading the bpel zip contains(deploy.xml,testif.wsdl,testif.bpel) it give the following error.



"File upload failed :BPEL Archive format error.Please confirm that the file being uploaded is a valid BPEL archive"

Could you please help me.
Thanks in Advance
Anil

Anonymous said...

Hi Denis,Thank you, and while i am uploading the bpel zip contains(deploy.xml,testif.wsdl,testif.bpel) it give the following error.



"File upload failed :BPEL Archive format error.Please confirm that the file being uploaded is a valid BPEL archive"

Could you please help me.
Thanks in Advance
Anil

Anonymous said...
This comment has been removed by the author.
Anonymous said...

Hi Denis,Thank you, and while i am uploading the bpel zip contains(deploy.xml,testif.wsdl,testif.bpel) it give the following error.



"File upload failed :BPEL Archive format error.Please confirm that the file being uploaded is a valid BPEL archive"
i am following the below example

http://svn.wso2.org/repos/wso2/branches/carbon/3.2.0/products/bps/2.1.2/modules/samples/product/src/main/resources/bpel/2.0/

TESTIF.zip
Could you please help me.
Thanks in Advance
Anil

Unknown said...

Hi Anil,
Could you please ask this question via dev@wso2.org. This is the community mailing list (http://wso2.org/mail) and community will help you this. I haven't use the recent WSO2 BPS, so I can't give an exact solution. Sorry for the inconvenience.

Anonymous said...

Hi Denis,

1.Is it possible to Consuming the Esb Prxoxy(wsdl), into BPEL and based on the Bpel condition replay back to Esb.

2. In Wso2 all service(proxy service,Data Service,Cusome Service) available to consume in Bpel. Is there any limitations..

Could you explain me .

Thanks in Advance
Anil

Anonymous said...

Hi Denis,

1.Is it possible to Consuming the Esb Prxoxy(wsdl), into BPEL and based on the Bpel condition replay back to Esb.

2. In Wso2 all service(proxy service,Data Service,Cusome Service) available to consume in Bpel. Is there any limitations..

Could you explain me .

Thanks in Advance
Anil

Unknown said...

Hi Anil,
Honestly I didn't get your 1st question. Can you explain what you meant by "Bpel condition replay back to Esb"?

Answering for the 2nd question, no there's no limitations.

Anonymous said...

Hi Denis,

Thankyou,

My Question:-

1. I created the one proxy service on my name(if username = anil the yes else false) in ESB.
I want to consume this proxy service in BPEL and bpel has decision maker of name = anil or not , then send back replay to Esb on terminal side.

Thanks in Advance
Anil

Unknown said...

Hi Anil,
Answering to question
"1. I created the one proxy service on my name(if username = anil the yes else false) in ESB.
I want to consume this proxy service in BPEL and bpel has decision maker of name = anil or not , then send back replay to Esb on terminal side."

Yes this is possible and you can do it using if activity.

Anonymous said...

Hi Denins,

Could you please explain me in more detail.

Thanks in Advance
Anil

Unknown said...

Hi Anil,
Will you be able to follow such a article and get some idea? I think this has what you need. http://www-inf.int-evry.fr/cours/WebServices/TP_BPEL/ifelse.html

Anonymous said...

Hi Denis,

Could you please give me any examples both combine ESB and BPEL..

means how BPEL Consume the ESB.
i didn't found any common example on this.

i found ESB sample,and Bpel sample,
but common example is not there.

Could you please give me any examples both combine ESB and BPEL..

It would be great example for me .

Thanks in Advance
Anil

Anonymous said...

Hi Denis,

Could you please give me any examples both combine ESB and BPEL..

means how BPEL Consume the ESB.
i didn't found any common example on this.

i found ESB sample,and Bpel sample,
but common example is not there.

Could you please give me any examples both combine ESB and BPEL..

It would be great example for me .

Thanks in Advance
Anil

Unknown said...

Hi Anil,
Can you extract out the WSDL from the service running in WSO2 ESB? (Then it's an few step process, I'll guide you with steps.)

Anonymous said...

Hi Denis,

Thank you,

I extract the WSDL from ESB

Could you please explain me the process.

Thanks in Advance
Anil

Anonymous said...

Hi Denis,

Thank you,

I extract the WSDL from ESB.

Could you please guide me.

Thanks in Advance
Anil

Anonymous said...

Hi Denis,

Thank you,

I extract the WSDL from ESB.

Could you please guide me.

Thanks in Advance
Anil

Unknown said...

Hi Anil,
Could you please follow this link which explain to use a WSDL to invoke the service from BPEL process.
http://wso2.org/library/tutorials/2011/04/using-carbon-studio-model-wsbpel-process-using-bpel-editor

Anonymous said...

Hi Denis,

Thank you,

I follow the link, zip(xml,bpel,wsdl)the file and import into bps server.
I click the "tryit" on Bps side it gives the error on Esb terminal side..

this is the following error.
1. ClientUtils The system cannot infer the transport information from the /services/myproxy.myproxyHttpSoap11Endpoint URL

2. Axis2Sender Unexpected error during sending message out.

Please help me .

Thanks in Advance
Anil

Anonymous said...

Hi Denis,

Thank you,

I follow the link, zip(xml,bpel,wsdl)the file and import into bps server.
I click the "tryit" on Bps side it gives the error on Esb terminal side..

this is the following error.
1. ClientUtils The system cannot infer the transport information from the /services/myproxy.myproxyHttpSoap11Endpoint URL

2. Axis2Sender Unexpected error during sending message out.

Please help me .

Thanks in Advance
Anil

Unknown said...

This is because, your extracted WSDL has a service endpoint which doesn't specify the transport protocol required. (eg- /services/myproxy.myproxyHttpSoap11Endpoint should be something like http://esb-server-ip/services/myproxy.myproxyHttpSoap11Endpoint)

Anonymous said...

Hi Denis,
Thank you,
The followoing is ESB service WSDL.

Could you please tell me transports and endpoints's issues.

--------------WSDL---------------------










































































-----------------------------------------
Thnaks in Advance
Anil



Anonymous said...

Hi Denis,
Thank you,
The followoing is ESB service WSDL.

Could you please tell me transports and endpoints's issues.

--------------WSDL---------------------










































































-----------------------------------------
Thnaks in Advance
Anil



Unknown said...

Hi Anil,
I cannot see the WSDL.
Can you please use https://gist.github.com and send me the link of the pasted WSDL?.

Cheers

Anonymous said...

Hi Denis,

Thankyou,

Here i am sending the Git URL:-

https://gist.github.com/6dcd536efcc4ae555bc8

Thanks in Advance
Anil

Anonymous said...

Hi Denis,

Thankyou,

Here i am sending the Git URL:-

https://gist.github.com/6dcd536efcc4ae555bc8

Thanks in Advance
Anil

Unknown said...

Hi Anil,
These sections should be properly fixed.

<wsdl:types/>
<wsdl:message name="in"/>
<wsdl:message name="out"/>

Please refer a WSDL included in http://wso2.org/files/FunctionProcess.zip . So you'll realize the WSDL is not ready to interface with a BPEL process.

Anonymous said...

Hi Denis,

Still i am getting the same errors.

1.Axis2Sender Unexpected error during sending message out

2.ClientUtils The system cannot infer the transport information from the /services/myproxy.myproxyHttpEndpoint/mediate URL

My all xml,bpel, and wsdl files in the GitHub

https://gist.github.com/d0527829c7940fab2958

Could you please correct me.

Thanks in Advance
Anil

Anonymous said...

Hi Denis,

Still i am getting the same errors.

1.Axis2Sender Unexpected error during sending message out

2.ClientUtils The system cannot infer the transport information from the /services/myproxy.myproxyHttpEndpoint/mediate URL

My all xml,bpel, and wsdl files in the GitHub

https://gist.github.com/d0527829c7940fab2958

Could you please correct me.

Thanks in Advance
Anil

Unknown said...

Hi Anil,
I tried to find the string "services/myproxy.myproxyHttpEndpoint/mediate" in your attached files, but couldn't. Could you please let me know from where does that string come?

Anonymous said...

Hi Denis,

String came from myproxy.wsdl(from ESB service wsdl)service port name as "myproxyHttpEndpoint" ..

And i called same in deploy.xml
as Service Port type.


Thanks in Advance
Anil




Anonymous said...

Hi Denis,

String came from myproxy.wsdl(from ESB service wsdl)service port name as "myproxyHttpEndpoint" ..

And i called same in deploy.xml
as Service Port type.


Thanks in Advance
Anil




Unknown said...

Thanks Anil,
I just saw, that you are using a rest invocation to the target endpoint.

I used GET and POST methods and I have uploaded the working samples at http://ddweerasiri.blogspot.com.au/2012_03_01_archive.html.

Please refer the deploy.xml and you can see how a rest invocation is configured.

<invoke partnerLink="restPL">
<service name="axis2:GetProxy" port="GetProxyHttpEndpoint" ><endpoint xmlns="http://wso2.org/bps/bpel/endpoint/config"
endpointReference="post.epr"/></service>
</invoke>

Here what we have done is overriding the transport bindning information in WSDL and using a Unified Endpoint to define the target endpoint.

Anonymous said...

Hi Dinesh,First thank you for your postings..I have one query can please help me.

I have to write time based scheduling in BPEL, is this is possible in BPEL, how write the time based properties in BPEL.Could you please explain me,

Thanks in Advance
Anil

Anonymous said...


Hi Denis,First thank you for your postings..I have one query can please help me.

I have to write time based scheduling in BPEL, is this is possible in BPEL, how to write the time based properties in BPEL.Could you please explain me,

Thanks in Advance
Anil