Home > Oracle, SOA > Invoke a Web service with Eclipse BPEL designer and Apache ODE

Invoke a Web service with Eclipse BPEL designer and Apache ODE

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 asBPEL_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. Select the Template as Synchronous BPEL Process. Click Next.

  3. Modify the Service Address as http://localhost:8080/ode/processes/WS_Invocation. Click Finish.
  4. Click and drag an Invoke action from the Palette to the BPEL process and name it as InvokePingPongService.
  5. Insert two other Assign actions before and after the Invoke action named AssignInputToSOAPRequest and AssignOutPutToResult.

  6. 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.
  7. Now, click on InvokePingPongService, in the Properties view, select Details→Partner Link→Create Global Partner Link. Name it as PingPongPL. Click OK.
  8. 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.

  9. Type the Partner Link Type Name as PingPongPLT. Click Next.
  10. Type the Role Name as PingPongPLRole, select the PingPong Port Type. Click Next.
  11. Ignore the second Role of the Partner Link. Click Finish.
  12. 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.

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

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

  15. 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.
  16. 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.
  17. At the Outbound Interfaces (Invokes), Partner Link is PingPongPL, select the Associated Port as PingPong and click on other field to fulfill it.

  18. Save file and open the Server view, right click on the Ode v1.x Server at localhost, select Add and Remove Projects. Select theBPEL_WS/WS_Invocation.bpel in the Available projects box and click Add. Then, click Finish.
  19. 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.
  20. Right click on the WS_InvocationArtifacts.wsdl file. Select Web Services→Test with Web Services Explorer.
  21. 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.

Advertisements
Categories: Oracle, SOA Tags: , , ,
  1. July 2, 2013 at 9:36 am
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: