题
我有一个wso2 esb-4.6.0代理调用调用WebService的另一个代理。
Proxy1 --> Proxy2 --> Endpoint
.
如果我通过SOAPUI直接调用第二个代理,则响应被正确返回并打印,但如果我调用第一个代理,则返回一个空白。
在ESB日志中,在Proxy2的曝光之前打印Proxy1的偏移。
似乎是诸如Proxy1的初始中存在的发送调解员正在对Proxy2进行异步呼叫。
我试图通过标注调解器更换发送调解员,但结果是相同的。
关注这个教程,但它也没有用。
如何将Proxy2转发给呼叫者的响应?
请帮忙。它杀了我!
编辑
问题解决了!我正在使用错误的端口来指定Callout Mediator的ServiceURL参数。
编辑
当前代理配置:
proxy1(调用代理2 - ManageWorkForce):
<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>
.
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服务。那些是 callout mediator 和呼叫调解器。标注调解器执行阻塞呼叫,呼叫中介执行非阻塞呼叫。
所以,如果考虑性能,您应该使用呼叫调解器。它在ESB 4.8.0中可用。
有两个样本这些在wiki文档中。
还有另一个 sample 呼叫来自杜尚的博客的调解员。这有更复杂的调解员,但你可以尝试。
这只是一个快速的答案。
我希望这有帮助。
谢谢!
其他提示
proxy1等待Proxy2的响应即使您使用发送调解员。 Proxy1的曝光不应在执行Proxy2的次序之前执行。
切换到Callout Mediator是不是这是一个理想的解决方案。 我认为代理配置应该有问题。
如果您可以在此发布代理配置,我们可能会为您提供帮助解决此问题。