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.
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.
Select the Template as Synchronous BPEL Process and modify the Service Address as http://localhost:8080/ode/processes/WS_Invocation. Click Next→ Finish.
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.
Click and drag an Invoke action from the Palette to the BPEL process and name it as InvokePingPongService.
Insert two other
Assign actions before and after the Invoke action named
AssignInputToSOAPRequest and
AssignOutPutToResult.
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.
Now, click on InvokePingPongService, in the Properties view, select Details→Partner Link→Create Global Partner Link. Name it as PingPongPL. Click OK.
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.
Type the Partner Link Type Name as PingPongPLT. Click Next.
Type the Role Name as PingPongPLRole, select the PingPong Port Type. Click Next.
Ignore the second Role of the Partner Link. Click Finish.
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.
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.
By the same way, select the
AssignOutPutToResult action and assign the
PingPongPLResponse→parameters→echoInputReturn to the
output→payload→result.
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.
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.
At the Outbound Interfaces (Invokes), Partner Link is
PingPongPL, select the Associated Port as
PingPong and click on other field to fulfill it.
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.
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.
Right click on the WS_InvocationArtifacts.wsdl file. Select Web Services→Test with Web Services Explorer.
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.
Done.