我从 Mule 流程开始,并看到了我已经看到这个页面http://www.mulesoft.org/documentation/display/MULE3CONCEPTS/Using+Mule+with+Web+Services和http://www.mulesoft.org /documentation/display/MULEWS/Consuming+SOAP+Web+Services+in+Mule这个也是。他们没有多大帮助。目前,我有一个简单的 mule 流程,如下所示。
流定义
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<flow name="EchoFlow" doc:name="EchoFlow">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8081" path="service/echoflow" doc:name="HTTP" />
<cxf:jaxws-client operation="" serviceClass="com.myapp.demo.ServiceAImplService"
doc:name="SOAP"/>
<outbound-endpoint address="http://localhost:8080/ServiceA/services/" doc:name="Generic"/>
</flow>
</mule>
我正在使用骡工作室。有一个 HTTP 入站端点需要响应。我尝试配置将调用实际 Web 服务的 jax-ws 客户端。该服务的 WSDL 是:
wsdl 文件
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="ServiceAImplService" targetNamespace="http://service.demo.myapp.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.demo.myapp.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.demo.myapp.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<import namespace="http://service.demo.myapp.com/" schemaLocation="http://localhost:8080/ServiceA/services/ServiceAImplPort?xsd=serviceaimpl_schema1.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="helloResponse">
<wsdl:part element="tns:helloResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="hello">
<wsdl:part element="tns:hello" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="IServiceA">
<wsdl:operation name="hello">
<wsdl:input message="tns:hello" name="hello">
</wsdl:input>
<wsdl:output message="tns:helloResponse" name="helloResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceAImplServiceSoapBinding" type="tns:IServiceA">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="hello">
<soap:operation soapAction="urn:Hello" style="document"/>
<wsdl:input name="hello">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="helloResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ServiceAImplService">
<wsdl:port binding="tns:ServiceAImplServiceSoapBinding" name="ServiceAImplPort">
<soap:address location="http://localhost:8080/ServiceA/services/ServiceAImplPort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
如您所见,我不太确定如何配置 jax-ws 客户端。那么,我究竟如何在这个流程中使用 SOAP Web 服务。
我的第二个问题:如何转换有效负载以从一个 Web 服务调用另一个 Web 服务(均为 SOAP)。流量会是什么?
最后,如何合并有效载荷?比如说,我有三个并行调用的 Web 服务,它们的响应都一起返回。如何合并有效负载以便我可以在另一个服务中读取它(在组合来自多个并行调用的服务的响应之后)?
什么是等效的实现
<pattern:web-service-proxy name="ex-proxy"
inboundAddress="http://localhost:8081/xxx"
outboundAddress="http://xx.xx.com/XXX_WS/xxxWService.asmx" />
使用 CXF 代理服务/客户端?这给我带来了另一个问题,什么时候使用 CXF-service,什么时候使用 CXF-client?最后,是否有 Mule Flow Orchestration 的详细文档或示例/教程?