在Activiti中从.bpmn文件触发SOAP Web服务

时间:2018-11-01 16:48:07

标签: soap alfresco activiti bpmn

问候社区,我已经用Java创建了最简单的SOAP服务,我想在我的.bpmn2文件中触发它,但是我找不到逐步实现该目的的示例。

该服务是以下类别

public class ServiceImpl implements Service {

@Override
public String helloWorld(){
  return "Hello World";
}

生成的.wsdl文件是

<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>
如您所见,

我暴露给我的本地主机的9080端口。我正在寻找一种在部署时通过我的.bpmn文件触发此 helloWorld 函数的方法。

我正在将 Alfresco Community Edition 6.0.0与activiti内置引擎一起使用

到目前为止,我所做的是在.bpmn文件中,如下所示导入了.wsdl文件:

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

我正在按照本教程https://www.activiti.org/userguide/#bpmnWebserviceTask进行操作,并且我知道我必须以某种方式使用 serviceTask ,但是我无法弄清楚接下来应该执行哪些步骤来触发此功能(例如,发送SOAP像下面这样的请求

 <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>

并获得响应。

在此先感谢您的帮助:)

0 个答案:

没有答案