Created
May 19, 2019 23:45
-
-
Save fjunior87/87216852dce7699110a4abd0e6c2f251 to your computer and use it in GitHub Desktop.
Revisions
-
fjunior87 created this gist
May 19, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ <?xml version="1.0" encoding="UTF-8"?> <api context="/calculator" name="CalculatorAPI" xmlns="http://ws.apache.org/ns/synapse"> <resource methods="GET" uri-template="/add/{number1}/{number2}"> <inSequence> <!-- Build Request --> <sequence description="Validating the input data" key="UnitTestExample_Validation_Sequence"/> <filter regex="FAILURE" source="get-property('VALIDATION_RESULT')"> <then> <sequence key="UnitTestExample_BuildFailureResponse_Sequence"/> </then> <else> <sequence key="UnitTestExample_BuildRequestPayload_Sequence"/> <!-- Send to Service --> <sequence key="UnitTestExample_SendRequest_Sequence"/> <sequence key="UnitTestExample_BuildResponsePayload_Sequence"/> <!-- build response payload --> </else> </filter> <log level="full"> <property expression="$ctx:VALIDATION_RESULT" name="ValidationResult"/> </log> <!-- Check if it was a failure - build error payload --> <!-- Else build request payload and send it --> <respond/> </inSequence> <outSequence/> <faultSequence/> </resource> </api>