【发布时间】:2018-05-18 20:44:26
【问题描述】:
有没有办法在 Apache Synapse 中以 JSON 形式从响应中获取价值?
这是一个示例 api 中介。
<api context="/accounts">
<resource methods="GET">
<inSequence>
<log level="full"/>
<send>
<endpoint>
<address uri="http://localhost:8988/accounts/">
</address>
</endpoint>
</send>
</inSequence>
<outSequence>
<log>
<property name="Status" expression="get-property('status')">
</log>
<log level="full"/>
<send/>
</outSequence>
</resource>
</api>
来自http://localhost:8988/accounts/ 的调用将产生这个json:
{
"accountNumber": "1234567890123456",
"status": "active"
}
点击outSeqeunce>log 后,get-property('status') 没有任何结果。
我知道 WSO2 中有一个函数,例如 json-eval,但解决方案必须限制使用 Apache Synapse。
【问题讨论】:
标签: json wso2esb mediator synapse