AnsweredAssumed Answered

Trigger a SOAP webservice from .bpmn file in alfresco activiti

Question asked by nickath on Nov 4, 2018
Latest reply on Nov 5, 2018 by nickath

Greetings to the community, I have created the simplest possible SOAP service in java and I would like to trigger it inside my .bpmn2 file but I cannot find a step-by-step example to achieve this.
The service is the following class:

public class ServiceImpl implements Service { @Overridepublic String helloWorld(){ return "Hello World";}

and the generated .wsdl file is 

 

<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://java.nick.org" xmlns:intf="http://java.nick.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://java.nick.org"> <!-- WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT) --><wsdl:types><schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.nick.org"><element name="helloWorld"><complexType/></element><element name="helloWorldResponse"><complexType><sequence><element name="helloWorldReturn" type="xsd:string"/></sequence></complexType></element></schema></wsdl:types><wsdl:message name="helloWorldRequest"><wsdl:part element="impl:helloWorld" name="parameters"> </wsdl:part></wsdl:message><wsdl:message name="helloWorldResponse"><wsdl:part element="impl:helloWorldResponse" name="parameters"> </wsdl:part></wsdl:message><wsdl:portType name="ServiceImpl"><wsdl:operation name="helloWorld"><wsdl:input message="impl:helloWorldRequest" name="helloWorldRequest"> </wsdl:input><wsdl:output message="impl:helloWorldResponse" name="helloWorldResponse"> </wsdl:output></wsdl:operation></wsdl:portType><wsdl:binding name="ServiceImplSoapBinding" type="impl:ServiceImpl"><wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="helloWorld"><wsdlsoap:operation soapAction=""/><wsdl:input name="helloWorldRequest"><wsdlsoap:body use="literal"/></wsdl:input><wsdl:output name="helloWorldResponse"><wsdlsoap:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="ServiceImplService"><wsdl:port binding="impl:ServiceImplSoapBinding" name="ServiceImpl"><wsdlsoap:address location="http://localhost:9080/soapExampleHelloWorld/services/ServiceImpl"/></wsdl:port></wsdl:service></wsdl:definitions>

which as you can see i expose to the port 9080 of my localhost. I am looking for a way to trigger this helloWorld function through my .bpmn file when this is deployed.

I am using Alfresco Community Edition 6.0.0 with activiti built-in engine

What I have done so far is inside my .bpmn file I import the the .wsdl file as shown below:

<import importType="http://schemas.xmlsoap.org/wsdl/" location="http://localhost:9080/soapExampleHelloWorld/services/ServiceImpl?wsdl" namespace="http://webservice.activiti.org"/> 

I am following this tutorial https://www.activiti.org/userguide/#bpmnWebserviceTask and I know that I somehow have to use the serviceTask but

I cannot clarify which steps should I follow next to trigger this function (f.e send a SOAP request like the below one

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://java.nick.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <q0:helloWorld/> </soapenv:Body></soapenv:Envelope>

 

and get the response.

Thanks in advance for any help

Outcomes