0
votes

I am trying to validate GET request parameter in proxy service in WSO2 ESB 4.0.3. I have following code logic

       <filter source="get-property('To')" regex="^(?=.*inSerialNr=).*$">
        <then>
           <send>
              <endpoint key="conf:/tqs/rma/ds_endpoint.xml" />
           </send>
        </then>
        <else>
           <log level="custom" separator=",">
              <property name="Missing-Input" value="Input validation failed...Missing Input Parameter - inSerialNr" />
           </log>
                <script language="js"><![CDATA[mc.setPayloadXML(<ERROR><DESCRIPTION>Input validation failed...Missing Input Parameter - inSerialNr</DESCRIPTION></ERROR>);]]></script>
           <property name="RESPONSE" value="true" scope="default" type="STRING" />
           <send>
              <endpoint key="conf:/tqs/tqsAnonymous.xml" />
           </send>
           <drop />
        </else>
     </filter>

I am expecting the message processing to be dropped when the parameter "inSerialNr" is missing. How ever it can not find the "http://www.w3.org/2005/08/addressing/anonymous" end point which is the client.

Even I tried doing the xslt to make the result as text/plain and send it back but still it can not find the send to anonymous end point. Since it can not find the end point it goes to outsequence and executes the code there.

How the error handling for the get parameter is done?

Please advice. thanks Abhijit

1

1 Answers

0
votes

please have a look at here[1]. This shows how to send an response message from the in sequence.

[1] http://wso2.org/library/knowledge-base/generating-simple-response-using-wso2-enterprise-service-bus