Invoke a Web service with Eclipse BPEL designer and Apache ODE

In this tutorial we will see how to invoke a remote web service using the Invoke action of the Eclipse BPEL Designer. The remote service used in this tutorial is the PingPong service, which returns the client exactly the input string together a the session ID.

Tools: Eclipse 3.6, BPEL Designer 0.5.0 Plugin, Tomcat 7.0.53, ODE 1.3.5

BPEL's WS invocation

  1. Create a new BPEL project named “BPEL_WS” by selecting File→New→Others→BPEL 2.0→BPEL Project. Select Next. Type the project name as BPEL_WS and select the Target Runtime as Apache ODE 1.x Runtime. Click Finish.
  2. Create a new BPEL process file named WS_Invocation by right clicking on the BPEL_WS/bpelContent folder, select New→Others→BPEL 2.0→New BPEL Process File. Click Next. Fill in BPEL Process Name the string WS_Invocation, and in the Namespace the string http://ws.invocation.tps. Click Next.
  3. Select the Template as Synchronous BPEL Process and modify the Service Address as http://localhost:8080/ode/processes/WS_Invocation. Click Next→ Finish.
  4. Open WS_InvocationArtifacts.wsdl. Right click on WS_InvocationPort. Select show properties and make sure that the Address is http://localhost:8080/ode/processes/WS_Invocation.
  5. Click and drag an Invoke action from the Palette to the BPEL process and name it as InvokePingPongService.
  6. Insert two other Assign actions before and after the Invoke action named AssignInputToSOAPRequest and AssignOutPutToResult.


  7. To invoke a web service, you have to know its description. In our example, we will invoke a PingPong web service and Here is its description file. Download it and copy it to your project.
  8. Now, click on InvokePingPongService, in the Properties view, select Details→Partner Link→Create Global Partner Link. Name it as PingPongPL. Click OK.
  9. A pop-up dialog appears. In this step, you have to select the Partner Link Type Structure which is the PingPong service. Select Add WSDL button. Then select the option From Project. Select the PingPong interface as the Partner Link Type Structure. Click OK.


  10. Type the Partner Link Type Name as PingPongPLT. Click Next.
  11. Type the Role Name as PingPongPLRole, select the PingPong Port Type. Click Next.
  12. Ignore the second Role of the Partner Link. Click Finish.
  13. Continue with the Details of the InvokePingPongService action. Select the Operation echoInput at the Quick Pick area. Other two variables are automatically generated which are PingPongPLRequest and PingPongPLResponse.


  14. Click on the AssignInputToSOAPRequest action. In the Properties view, select Details→New and assign the input→payload→input to PingPongPLRequest→Parameters→input. A pop-up dialog appears to ask you about the variable initiation. Select Yes.


  15. By the same way, select the AssignOutPutToResult action and assign the PingPongPLResponse→parameters→echoInputReturn to the output→payload→result.


  16. Save the files. Right click on the BPEL_WS/bpelContent, select New→Others→BPEL 2.0→Apache ODE Deployment Descriptor. Click Next. Verify the BPEL Project name as /BPEL_WS/bpelContent. Click Finish.
  17. Now you have the file deploy.xml in your project. Right click on this file. Select Open With→ODE Deployment Descriptor Editor. At the Inbound Interfaces (Services), Partner Link is the client, select the Associated Port as WS_InvocationPort and click on other field. Eclipse will automatically fill in other fields.
  18. At the Outbound Interfaces (Invokes), Partner Link is PingPongPL, select the Associated Port as PingPong and click on other field to fulfill it.


  19. Save file and open the Server view, right click on the Ode v1.x Server at localhost, select Add and Remove Projects. Select the BPEL_WS/WS_Invocation.bpel in the Available projects box and click Add. Then, click Finish.
  20. Start the ODE server to deploy the WS_Invocation BPEL process on the server. We will use the Eclipse's Web Services Explorer to test our application.
  21. Right click on the WS_InvocationArtifacts.wsdl file. Select Web Services→Test with Web Services Explorer.
  22. Select the operation process. Then, type Hello PingPong Service in the input textbox. If your deployment was successful, you will get the string like the folowing in the SOAP response.


  23. Done.

Exercices

  1. Create another BPEL process which invoke the simple Sum service, which returns the sum of two integers. Here is the WSDL file of this service.
  2. Create a BPEL process to invoke the String Analysis service which is described by the WSDL file. This service analyzes the input string and returns some information related to the string, including the number of characters, the number of words and the longest word.
  3. Create a BPEL process using the Simple Calculator service to compute the formula f=(a+b)*h. Here is the description service. Tip: use two invoke actions.
  4. There are two other services which compute the area of a rectangle and an ellipse. Now, use these services and the Simple Calculator service above to create a PBEL process to compute the area limited by a rectangle and an ellipse inscribed in that rectangle. Tip: use three invoke actions.

    Rectangle Computation Service Ellipse Computation Service Problem
    Input=(h,b) Input=(a,b) Red area = ?

Resources for this tutorial

teaching_assistant/bpel/invoke_a_web_service_with_eclipse_bpel_designer_and_apache_ode.txt · Last modified: 2014/04/14 09:40 by IT Courses (NNC)
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0