how to write expression in WSO2 for filter mediator for 200 and other than 200 response codes

15 Views Asked by At

If the xml request is success "then" 200 if any other response code is generated once request is send it should be "else"

Should I define property group for this, if so how to write the expressions for 200 and non-200 codes

1

There are 1 best solutions below

0
ycr On

Check the following code snippet.

<filter regex="200" source="$axis2:HTTP_SC">
    <then>
        // 200
    </then>
    <else>
        // Not 200
    </else>
</filter>