Api 从';至';wso2中的作用
我在wso2ei中创建了一个api,如下所示:Api 从';至';wso2中的作用,api,wso2,wso2esb,wso2ei,Api,Wso2,Wso2esb,Wso2ei,我在wso2ei中创建了一个api,如下所示: <api xmlns="http://ws.apache.org/ns/synapse" name="Test" context="/Test" version="/" version-type="context"> <resource methods="POST" url-mapping="/CheckTest" inSequence="TestSequence"> <outSequence> &
<api xmlns="http://ws.apache.org/ns/synapse" name="Test" context="/Test" version="/" version-type="context">
<resource methods="POST" url-mapping="/CheckTest" inSequence="TestSequence">
<outSequence>
<send/>
</outSequence>
</resource>
<resource methods="POST" url-mapping="/TransferTest" inSequence="TestSequence">
<outSequence>
<send/>
</outSequence>
</resource>
</api>
将消息发送到sequence后,我希望获取url映射值作为属性。”To’行动是针对CheckTest的/Test/CheckTest和针对TransferTest的/Test/TransferTest。我想获取动态选择的url映射值或资源。我该怎么做
<property name="urlMappingValue" expression=?/>
您需要使用带有uri模板的资源,然后通过uri.var访问属性中的uri部分
<api xmlns="http://ws.apache.org/ns/synapse" name="Test" context="/Test">
<resource methods="POST" uri-template="/{method}">
<inSequence>
<property name="method" expression="get-property('uri.var.method')" scope="default" type="STRING"/>
<switch source="get-property('uri.var.method')">
<case regex="CheckTest">
... Your logic for Check Test...
</case>
<case regex="TransferTest">
... Your logic for Transfer Test...
</case>
</switch>
</inSequence>
</resource>
</api>
... 你的逻辑检查测试。。。
... 你的逻辑转移测试。。。
您需要使用带有uri模板的资源,然后通过uri.var访问属性中的uri部分
<api xmlns="http://ws.apache.org/ns/synapse" name="Test" context="/Test">
<resource methods="POST" uri-template="/{method}">
<inSequence>
<property name="method" expression="get-property('uri.var.method')" scope="default" type="STRING"/>
<switch source="get-property('uri.var.method')">
<case regex="CheckTest">
... Your logic for Check Test...
</case>
<case regex="TransferTest">
... Your logic for Transfer Test...
</case>
</switch>
</inSequence>
</resource>
</api>
... 你的逻辑检查测试。。。
... 你的逻辑转移测试。。。