This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Invoking a SOAP Endpoint from a BPMN Workflow
BPMN SOAP tasks allow you to invoke SOAP endpoints within your BPMN processes. This can be achieved by adding a SOAP Task and handling the SOAP invocation part in a process implementation. EI-Business Process has provided this functionality out of the box to avoid the hassle of doing implementations by process developers.
Adding a SOAP task to a process
- Create a BPMN process and a BPMN diagram. For instructions, see Creating a BPMN Process.
- Drag and drop a SOAP Task from the tools palette in the place where you need to invoke the endpoint.Â
- Go to the Properties panel of the SOAP Task and select the Main config tab.Â
Enter values for the following fields appropriately, as shown in the example below.
Field Name String Value Required/Optional Service URLÂ URL of the target endpoint Required Input Payload Request payload Optional SOAP Headers SOAP header block, which is attached to the SOAP header when creating the SOAP request Optional SOAP version Soap version to be used when creating the SOAP request (i.e., SOAP11 or SOAP12) Required HTTP Connection Control options for the current connection. ('keep-alive' is the the default value.) Optional HTTP Transfer Encoding The form of encoding, which is used to safely transfer the entity to the user Optional Output Variable name Name of the variable to save the response Required Transport headers Header values in the format
"headerName0":"headerValue0","headerName1":"header Value2"
Optional
The following configuration provides an example definition to use as the SOAP task.
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> <process id="myProcess" name="My process" isExecutable="true"> <serviceTask id="servicetask1" name="SOAP Task" activiti:class="org.wso2.carbon.bpmn.extensions.soap.SOAPTask" activiti:extensionId="org.wso2.developerstudio.bpmn.extensions.soapTask.SOAPTask"> <extensionElements> <activiti:field name="serviceURL"> <activiti:expression>http://10.0.3.1:9773/soapSample1_1.0.0/services/soap_sample1/${method}</activiti:expression> </activiti:field> <activiti:field name="payload"> <activiti:string><m:getFullQuote xmlns:m="http://services.samples/xsd"> <m:request> <m:symbol>IBM</m:symbol> </m:request> </m:getFullQuote> </activiti:string> </activiti:field> <activiti:field name="headers"> <activiti:string><headers:ServerHeader xmlns:headers="http://www.roguewave.com/examples/webservice/headers" env:mustUnderstand="0">MyValue: From the server</headers:ServerHeader> </activiti:string> </activiti:field> <activiti:field name="soapVersion"> <activiti:string>soap11</activiti:string> </activiti:field> <activiti:field name="httpConnection"> <activiti:string>keep-alive</activiti:string> </activiti:field> <activiti:field name="outputVariable"> <activiti:string>output</activiti:string> </activiti:field> <activiti:field name="soapAction"> <activiti:string>urn:sayHello</activiti:string> </activiti:field> <activiti:field name="transportHeaders"> <activiti:string><p1:Code xmlns:p1="http://www.XYZ.com/XSD">XYZ</p1:Code> </activiti:string> </activiti:field> </extensionElements> </serviceTask> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess"> <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess"> <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1"> <omgdc:Bounds height="55.0" width="105.0" x="340.0" y="60.0"></omgdc:Bounds> </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </definitions>