在WSO2 ESB 4.0.3中验证GET请求参数时出错

时间:2012-07-25 23:04:27

标签: wso2 wso2esb

我正在尝试在WSO2 ESB 4.0.3中验证代理服务中的GET请求参数。我有以下代码逻辑

       <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>

我希望在缺少参数“inSerialNr”时删除消息处理。怎么也找不到作为客户的“http://www.w3.org/2005/08/addressing/anonymous”终点。

即使我尝试使用xslt将结果作为text / plain发送并将其发回,但仍无法找到发送到匿名端点。由于它无法找到终点,因此会在那里执行代码。

如何完成get参数的错误处理?

请指教。 谢谢 作者Abhijit

1 个答案:

答案 0 :(得分:0)

请看这里[1]。这显示了如何从顺序发送响应消息。

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