WSO2 ESB:显示数据服务响应
如何显示通过调用序列上的webservice端点返回的响应 下面是我使用的顺序。我想在wso2carbon.log上显示名为CDServiceEndpoint的数据服务的返回值。可能吗?如果没有,如何显示数据WSO2 ESB:显示数据服务响应,wso2,sequence,wso2esb,wso2carbon,wso2dss,Wso2,Sequence,Wso2esb,Wso2carbon,Wso2dss,如何显示通过调用序列上的webservice端点返回的响应 下面是我使用的顺序。我想在wso2carbon.log上显示名为CDServiceEndpoint的数据服务的返回值。可能吗?如果没有,如何显示数据 <sequence xmlns="http://ws.apache.org/ns/synapse" name="ConcurGetADPExtractFlow" onError="GeneralErrorHandler"> <property xmlns:ns="h
<sequence xmlns="http://ws.apache.org/ns/synapse" name="ConcurGetADPExtractFlow" onError="GeneralErrorHandler">
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="current-context-details" expression="concat(get-property('current-context-details'), ', ConcurGetADPExtractFlow')" />
<property name="scenario" value="ConcurGetADPExtractFlow" />
<log level="custom">
<property name="DEBUGGING" value="ConcurGetADPExtractFlow" />
<property name="start-date" value="2015-02-23" />
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="End Date" expression="get-property('current-date')" />
</log>
<xslt key="Concur_Get_ADP_Extract_Transformation">
<property name="start-date" value="2015-03-02" />
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="end-date" expression="get-property('current-date')" />
</xslt>
<property name="post-data-service-sequence" value="ConcurTransformADPExtractFlow" />
<property name="OUT_ONLY" value="false" />
<send receive="DataServiceInvocationErrorFlow">
<endpoint key="ConcurDataServiceEndpoint" />
</send>
<description>Sends a request to the data service for the ADP extract data.</description>
</sequence>
下面是我的DataServiceInvocationErrorFlow的样子
<sequence xmlns="http://ws.apache.org/ns/synapse" name="DataServiceInvocationErrorFlow">
<filter xmlns:ns="http://org.apache.synapse/xsd" xmlns:m="http://ws.wso2.org/dataservice" xmlns:ns3="http://org.apache.synapse/xsd" xpath="//m:DataServiceFault">
<then>
<log level="custom">
<property name="status" value="data-service-fault" />
</log>
<property name="error_message" expression="//m:DataServiceFault" />
<sequence key="GeneralErrorHandler" />
<drop />
</then>
<else>
<filter source="string-length(get-property('ERROR_MESSAGE'))" regex="0.0">
<then>
<filter xpath="//soapenv:Fault">
<then>
<log level="custom">
<property name="status" value="ERROR" />
</log>
<property name="error_message" expression="//soapenv:Fault" />
<sequence key="GeneralErrorHandler" />
<drop />
</then>
<else>
<log level="custom">
<property name="status" value="success response from DSS" />
</log>
<filter source="string-length(normalize-space(get-property('post-data-service-sequence')))" regex="0.0">
<then />
<else>
<property name="temp-post-data-service-sequence" expression="get-property('post-data-service-sequence')" />
<property name="post-data-service-sequence" value="" />
<sequence key="{get-property('temp-post-data-service-sequence')}" />
</else>
</filter>
</else>
</filter>
</then>
<else>
<property name="error_message" expression="get-property('ERROR_MESSAGE')" />
<sequence key="GeneralErrorHandler" />
<drop />
</else>
</filter>
</else>
</filter>
</sequence>
如果CDServiceEndpoint指的是ConcurDataServiceEndpoint,那么您已经在发送中介上定义的DataServiceInvocationErrorFlow序列中处理来自该端点的响应,顺便说一句,该序列的名称令人困惑,因为无论您得到的是错误响应还是良好响应,接收序列都将运行。您只需使用日志中介器将其记录在DataServiceInvocationErrorFlow中
如果您没有在Send mediator上定义接收序列,则响应将到达outSequence,您也可以使用log mediator记录它。谢谢,我已将我的答案作为另一个添加到此线程中。是的,我所说的CDServiceEndpoint是指ConcurDataServiceEndPoint。@Gopi:因此,也可以在DataServiceInvocationErrorFlow中处理您的成功响应,并可能更改其名称,使其不只是反映错误流。请注意,您当前正在过滤掉其中的任何非错误消息。