从WSO2中的SOAP响应中获取JSON消息
...
<property expression="//soap:Envelope/soap:Body/Response/Result" name="result"/>
<log>
<property expression="get-property('result')" name="result"/>
</log>
...
响应
...
<response> [ { "_id": "62908b4267c5284f7fa8320e", "index": 0, "serial": "11006883-fb2b-49ba-a6f7-0ec0daafa1c5", "Active": false, "balance": "$3,723.68", ,"age": 34 }] </response>
如何获得ID和平衡的响应属性? 当我使用
<log>
<property expression="get-property('response')" name="response"/>
</log>
时,它仅返回JSON数组仅
...
<property expression="//soap:Envelope/soap:Body/Response/Result" name="result"/>
<log>
<property expression="get-property('result')" name="result"/>
</log>
...
the response
...
<response> [ { "_id": "62908b4267c5284f7fa8320e", "index": 0, "serial": "11006883-fb2b-49ba-a6f7-0ec0daafa1c5", "Active": false, "balance": "$3,723.68", ,"age": 34 }] </response>
How do i get the response property for id and balance?
When i use
<log>
<property expression="get-property('response')" name="response"/>
</log>
it only returns the Json array only only
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们可以假设有效负载看起来像下面。
我们将将
&lt;响应&gt;
标记值存储到以下类似的属性中。发布该内容,将使用
RENRICH
调解器将属性值转换为身体。最后,我们可以使用
xpath
来获取_id,ballace
从有效负载输出:
We can assume payload look like below.
We're going to store
<response>
tag values into property like below.Post that, going to use
enrich
mediator to convert property value into body.Finally we can use
xpath
to fetch values like_id,balance
from payloadOutput:
假设您在XML响应中有有效的JSON。您可以执行以下操作以获得ID和平衡。在这里,您必须使用脚本中介。
Assuming you have a valid Json within your XML response. You can do the following to get the ID and balance. Here you have to use a script mediator.