Я начинаю с потоков 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 это тоже. Они не очень помогли. В настоящее время у меня есть простой поток мулов, как показано ниже.
Определение потока
<?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>
Я использую студию Mule. Существует входящая конечная точка HTTP, которая ожидает ответа. Я попытался настроить клиент 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 в этом потоке.
Мой второй вопрос: как мне преобразовать полезную нагрузку, чтобы сделать вызов из одной веб-службы в другую веб-службу (оба SOAP). Какой будет поток?
И, наконец, как мне объединить полезные нагрузки? Скажем, у меня есть три веб-службы, вызываемые параллельно, и все их ответы возвращаются вместе. Как объединить полезные данные, чтобы их можно было прочитать в другой службе (после объединения ответов от нескольких служб, вызываемых параллельно)?
Какова эквивалентная реализация
<pattern:web-service-proxy name="ex-proxy"
inboundAddress="http://localhost:8081/xxx"
outboundAddress="http://xx.xx.com/XXX_WS/xxxWService.asmx" />
используя прокси-сервис/клиент CXF? И это подводит меня к другому вопросу, когда использовать CXF-сервис и когда использовать CXF-клиент? И, наконец, есть ли подробная документация или пример/руководство по Mule Flow Orchestration?