私は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このoeもあります。彼らはあまり役に立たなかった。現在、以下に示すような簡単なミュールフローがあります。MuleフローでSOAP Webサービスを使用するには?
フロー定義
<?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サービスをどのくらい正確に消費しますか。
私の2番目の質問:どのように私は別のWebサービス(SOAPの両方)への1つのWebサービスからの呼び出しを行うためにペイロードを変換します。どのような流れになりますか?
最後に、ペイロードをどのようにマージしますか?さて、3つのWebサービスが並行して呼び出され、その応答がすべて返されます。ペイロードをマージして、(複数のサービスからの応答を組み合わせて)別のサービスで読むことができるようにするにはどうすればよいですか?
CXFプロキシサービス/クライアントを使用して
<pattern:web-service-proxy name="ex-proxy"
inboundAddress="http://localhost:8081/xxx"
outboundAddress="http://xx.xx.com/XXX_WS/xxxWService.asmx" />
の同等の実装は何ですか? CXFサービスをいつ使用するのか、またCXFクライアントをいつ使用するのかという別の質問に私は気づきます。最後に、Mule Flow Orchestrationの詳細なドキュメントやサンプル/チュートリアルがありますか?
@ペッターの答えはあなたに良い手がかりを与えます。あなたの質問で不明な点の1つは、全体的なサービス自体を公開したいのですか?別のWebサービスとして、または単純なHTTPリソースとして(現在あなたの例に示されているように)? –
私はコンポーネントを認識しています。しかし、適切なドキュメンテーション/例がないので、正しく設定することはできません!シンプルなCXFプロキシの例は私を助けてくれるでしょう。私はコードを尋ねることは一度もありませんが、進歩なしに1週間これで悩んでいます! – r3st0r3
jaxws-clientの操作属性が ""であることがわかりますが、これは正しいとは言えません。代わりに "hello"を使ってみましたか?どのようなエラーが出ますか? –