Working with SOAP Tasks
BPMN SOAP tasks allow you to invoke SOAP endpoints within your BPMN processes. You can achieve this by adding a SOAP Task and handling the SOAP invocation part in a process implementation. This tutorial simulates the scenario of invoking the echo SOAP service, which is shipped with WSO2 EI by default.
Before you begin,
- Install Oracle Java SE Development Kit (JDK) version 1.8.* and set the
JAVA_HOME
environment variable. - Download the product installer from here, and run the installer.
Let's call the installation location of your product the <EI_HOME> directory.If you installed the product using the installer, this is located in a place specific to your OS as shown below:
OS Home directory Mac OS /Library/WSO2/EnterpriseIntegrator/6.5.0
Windows C:\Program Files\WSO2\EnterpriseIntegrator\6.5.0\
Ubuntu /usr/lib/wso2/EnterpriseIntegrator/6.5.0
CentOS /usr/lib64/EnterpriseIntegrator/6.5.0
Select and download the relevant WSO2 Integration Studio ZIP file depending on your operating system from here, and then extract the ZIP file.
- For more detailed installation instructions, see Installing WSO2 Integration Studio.
- For information on any error messages you get, see the troubleshooting tips given under Troubleshooting WSO2 Integration Studio.
Creating the BPMN artifacts
Follow the steps below to create the BPMN artifacts including the SOAP Task.
- Create a new BPMN project named SoapTaskBPMN. For instructions, see Creating a BPMN Project.
- Create a BPMN Diagram named SoapTask.bpmn. For instructions, see Creating the BPMN Diagram.
- Click anywhere on the canvas, go to the Properties tab, and fill in the following details:
Id :soapTask
Name :SOAP Task Process
Namespace:http://wso2.org/bpmn/soapTask
To implement the order approval process, drag and drop a Start Event element, a SOAP Task element, a User Task element and an End Event element to the canvas.
You view the Create connection option when you hover the mouse pointer on an artifact. Click on the arrow, drag it and drop it on the artifact to which you want to connect it.
Configuring the SOAP Task
- Select the Properties tab of the REST Task, click General and enter the Name as Echo Request.
In the Properties tab of the SOAP Task, click Main config and update the following:
Service URL http://localhost:9765/services/echo.echoHttpSoap11Endpoint/
Input Payload <echo:echoInt xmlns:echo="http://echo.services.core.carbon.wso2.org">
<!--Optional:-->
<in>50</in>
</echo:echoInt>
Soap version soap11 Output Variable name response Soap action urn:echoInt
Configuring the User Task
- Select the Properties tab of the User Task, click General and enter the Name as Echo Response.
- Click Properties, click Main config and give
admin
as the Assignee. In the Properties tab click Form, click New and add the following.
Id Name Type Variable Readable Writable Required response Echo Response string response True False True You view the field added to the Form of the User Task as shown below.
Press Ctrl+S to save all your artifacts.
Deploying the artifacts
- For instructions on creating the deployable artifacts, see Creating the deployable archive.
- For instructions on deploying them, see Deploying BPMN artifacts.
Testing the output
If you have not started the business profile previously, you need to start it.
- Log in to the BPMN-explorer at https://localhost:9445/bpmn-explorer using
admin
for both the username and password. - Click PROCESSES in the top menu, and click the Start option of the REST Task Process.
This creates a Claimable Task. - Click TASKS in the top menu, and then click Claimable Tasks.
Click on the new Claimable Task.
You view the response of the Echo Service.- Click Complete Task, to approve the appointment.
- Click TASKS → COMPLETED TASKS to view the completed task.