如何在没有 200 错误的情况下发送邮件 WSO2 迭代调用

how to send the mail with out 200 error WSO2 iterate calling

我正在使用 wso2 ESB 6.3.0 我的完整功能是:调用服务休息 api 如果收到任何响应以发送邮件过程已完成但要求没有 200 状态代码 remaimimg 发送邮件的任何状态代码(例如:我收到错误代码或发送成功代码发送邮件reming 200错误代码如果任何错误代码发送mail.if任何人请建议我。

<?xml version="1.0" encoding="UTF-8"?>
<api context="/first" name="firston" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET">
        <inSequence>
            <property description="http" name="HTTP_SC" scope="axis2" type="STRING" value="404"/>
            <log level="full"/>
            <send>
                <endpoint key="firstapi"/>
            </send>
        </inSequence>
        <outSequence>
            <switch source="get-property('axis2','HTTP_SC')">
                <case regex="200">
                    <log description="200log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="200reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="200reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="200reshttpsc"/>
                    </log>
                </case>
                <case regex="400">
                    <log description="400log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="400reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="400reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="400reshttpsc"/>
                    </log>
                </case>
                <case regex="404">
                    <log description="404log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="404reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="404reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="404reshttpsc"/>
                    </log>
                </case>
                <case regex="500">
                    <log description="500log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="500reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="500reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="500reshttpsc"/>
                    </log>
                </case>
                <default>
                    <log description="reslog" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="reshttpsc"/>
                    </log>
                </default>
            </switch>
            <clone continueParent="true">
                <target>
                    <sequence>
                        <sequence key="sendthemail"/>
                    </sequence>
                </target>
            </clone>
            <send/>
        </outSequence>
        <faultSequence>
            <switch source="get-property('axis2','HTTP_SC')">
                <case regex="200">
                    <log description="200log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="200errorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="200errormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="200httpsc"/>
                    </log>
                </case>
                <case regex="400">
                    <log description="400log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="400errorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="400errormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="400httpsc"/>
                    </log>
                </case>
                <case regex="404">
                    <log description="404log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="404errorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="404errormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="404httpsc"/>
                    </log>
                </case>
                <case regex="500">
                    <log description="500log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="500reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="500reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="500reshttpsc"/>
                    </log>
                </case>
                <default>
                    <log description="faultlog" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="faulterrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="faulterrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="faulthttpsc"/>
                    </log>
                </default>
            </switch>
            <clone continueParent="true">
                <target>
                    <sequence>
                        <sequence key="sendthemail"/>
                    </sequence>
                </target>
            </clone>
            <send/>
        </faultSequence>
    </resource>
</api>

所有代码都在工作任何状态代码 200 或 404 或 500 等任何状态代码发送邮件我的要求是状态代码 !=200 剩余任何状态代码发送邮件请任何人给我建议

很简单,下面是代码

 <switch source="get-property('axis2','HTTP_SC')">
                    <case regex="200"><!-- Do not do anything here as it's success -->
                        <log description="200log" level="custom">
                            <property expression="$ctx:ERROR_CODE" name="200reserrorcode"/>

                        </log>
                    </case>

                    <default><!-- Put your logic here to send mail -->
                        <log description="reslog" level="custom">
                            <property expression="$ctx:ERROR_CODE" name="reserrorcode"/>
                            <property expression="$ctx:ERROR_MESSAGE" name="reserrormessage"/>
                            <property expression="get-property('axis2','HTTP_SC')" name="reshttpsc"/>
                        </log>
                    </default>
                </switch>