我想使用故障序列处理错误,但我希望使用删除操作对其进行自定义我的情况是当我在 2 个表中插入时,如果在第 2 个表插入中发生错误我需要删除第 1 行插入,我的配置也在下面
<proxy xmlns="http://ws.apache.org/ns/synapse" name="ErrorHandling" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target >
<inSequence onError="fault">
<property name="eno" expression="//eno/text()" scope="default" type="STRING"/>
<property name="ename" expression="//ename/text()" scope="default" type="STRING"/>
<property name="esal" expression="//esal/text()" scope="default" type="STRING"/>
<property name="deptname" expression="//deptname/text()" scope="default" type="STRING"/>
<property name="deptid" expression="//deptid/text()" scope="default" type="STRING"/>
<payloadFactory>
<format>
<p:insert_emp_operation xmlns:p="http://ws.wso2.org/dataservice">
<xs:eno xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:eno>
<xs:ename xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:ename>
<xs:esal xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:esal>
</p:insert_emp_operation>
</format>
<args>
<arg expression="get-property('eno')"/>
<arg expression="get-property('ename')"/>
<arg expression="get-property('esal')"/>
</args>
</payloadFactory>
<send receive="Error_Seq">
<endpoint>
<address uri="http://localhost:9764/services/emp_DataService/" format="soap11"/>
</endpoint>
</send>
<log level="full"/>
</inSequence>
<outSequence onError="fault">
<send/>
<log level="full"/>
</outSequence>
</target>
<description></description>
</proxy>
和序列是这样的
<sequence xmlns="http://ws.apache.org/ns/synapse" name="Error_Seq" onError="fault">
<property xmlns:f="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd" name="ID" expression="//f:ID/text()" scope="default" type="STRING"/>
<log>
<property xmlns:ns="http://org.apache.synapse/xsd" name="faisal" expression="get-property('ID')"/>
</log>
<payloadFactory>
<format>
<p:insert_dept_operation xmlns:p="http://ws.wso2.org/dataservice">
<xs:deptno xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:deptno>
<xs:deptname xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:deptname>
<xs:deptid xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:deptid>
</p:insert_dept_operation>
</format>
<args>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('ID')"/>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('deptname')"/>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('deptid')"/>
</args>
</payloadFactory>
<send>
<endpoint>
<address uri="http://localhost:9764/services/dept_DataService/" format="soap11"/>
</endpoint>
</send>
</sequence>
故障顺序是这样的
<sequence xmlns="http://ws.apache.org/ns/synapse" name="fault">
<property xmlns:ns="http://org.apache.synapse/xsd" name="ID" expression="get-property('ID')" scope="default" type="STRING"/>
<log level="full">
<property name="MESSAGE" value="Executing default 'fault' sequence"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="Property" expression="get-property('ID')"/>
</log>
<payloadFactory>
<format>
<p:Delete_Op xmlns:p="http://ws.wso2.org/dataservice">
<xs:eno xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:eno>
</p:Delete_Op>
</format>
</payloadFactory>
<send>
<endpoint>
<address uri="http://localhost:9764/services/dept_DataService/" format="soap11"/>
</endpoint>
</send>
</sequence>
但它在 DSS 处于关闭模式时无法正常工作让我知道 DSS 处于运行模式时如何删除第一个表行