WSO2を送信するのはなぜ仲介者が返答を待たないのですか?
質問
私はWebServiceを呼び出す別のプロキシを呼び出すWSO2 ESB-4.6.0プロキシを持っています。
Proxy1 --> Proxy2 --> Endpoint
.
SOAPUIを介して2番目のプロキシを直接呼び出すと、応答が正しく返されて印刷されますが、最初のプロキシを呼び出すと空白の本体が返されます。
ESBログでは、Proxy1のOutSequenceがProxy2のOutSequenceの前に印刷されます。
Proxy1のInSequenceに存在する送信メディエータがProxy2への非同期呼び出しをしているようです。
送信メディエータをコールアウトメディエータで置き換えようとしましたが、結果は同じです。
this. チュートリアルですが機能しませんでした。
Proxy2の応答を発信者に転送する方法は?
助けてください。それは私を殺しています!
編集
問題解決!コールアウトメディエータのServiceURLパラメータを指定するために間違ったポートを使用していました。
編集
現在のプロキシ設定:
Proxy1(呼び出しプロキシ2 - ManageWorce):
<proxy xmlns="http://ws.apache.org/ns/synapse" name="GetAppointmentSchedulePortalReqCS" transports="http https" startOnLoad="true" trace="disable">
<target>
<inSequence>
<xslt key="conf:ManageWorkforce/xslt/GetAppointmentSchedulePortalReqCS_Request.xsl"/>
<header name="Action" value="getAppointment"/>
<send>
<endpoint>
<address uri="https://localhost:9443/services/ManageWorkforce"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<xslt key="conf:ManageWorkforce/xslt/GetAppointmentSchedulePortalReqCS_Response.xsl"/>
<send/>
</outSequence>
<faultSequence/>
</target>
<publishWSDL key="conf:ManageWorkforce/GetAppointmentSchedulePortalReqCS.wsdl" />
</proxy>
.
プロキシ2(Proxy3 -GetAppointmentPeopleProvcsを呼び出す):
<proxy xmlns="http://ws.apache.org/ns/synapse" name="ManageWorkforce" transports="https http" startOnLoad="true" trace="disable">
<target>
<inSequence>
<switch source="get-property('Action')">
<case regex="getAppointment">
<callout serviceURL="https://localhost:8243/services/GetAppointmentPeopleProvCS" action="getAppointment">
<source xmlns:s12="http://www.w3.org/2003/05/soap-envelope" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
<target xmlns:s12="http://www.w3.org/2003/05/soap-envelope" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
</callout>
</case>
<!-- another cases -->
<default/>
</switch>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<header name="To" action="remove"/>
<send/>
</inSequence>
<outSequence>
<drop/>
</outSequence>
<faultSequence/>
</target>
<publishWSDL key="conf:ManageWorkforce/ManageWorkforce.wsdl"/>
</publishWSDL>
</proxy>
.
プロキシ3(Service-GetAppointmentを呼び出す):
<proxy xmlns="http://ws.apache.org/ns/synapse" name="GetAppointmentPeopleProvCS" transports="http https" serviceGroup="" startOnLoad="true" trace="disable">
<target>
<endpoint key="GetAppointment"/>
<inSequence>
<xslt key="conf:ManageWorkforce/xslt/GetAppointmentPeopleProvCS_Request.xsl"/>
</inSequence>
<outSequence>
<xslt key="conf:ManageWorkforce/xslt/GetAppointmentPeopleProvCS_Response.xsl"/>
<send/>
</outSequence>
<faultSequence/>
</target>
</proxy>
.
最終エンドポイント(サービス):
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="GetAppointment">
<address uri="http://10.13.6.75:9764/services/GetAppointment" />
</endpoint>
. 解決
Webサービスを呼び出すための2つのメディエータがあります。これらはコールアウトMediator と Call Mediator 。コールアウトメディエータはブロッキングコールを実行し、呼メディエータは非ブロックコールを実行します。
だから、パフォーマンスについて考慮した場合は、Call Mediatorを使用する必要があります。ESB 4.8.0に入手可能です。
2つのこれらのためのサンプル。
sample Dushanのブログからのメディエーター。これにはより複雑なメディエータがありますが、試してみることができます。
これは単なる迅速な答えです。
これが助けを願っています。
ありがとう!
他のヒント
Proxy1は、Send Mediatorを使用することでさえプロキシ2からの応答を待ちます。 Proxy1のOutSequenceは、Proxy2のOutSequenceの実行前に実行されません。
コールアウトメディエータへの切り替えは、このための理想的な解決策です。 プロキシ構成に問題があるはずです。
ここでプロキシ構成を投稿できる場合は、これを解決するための助けを与えることができるかもしれません。