WSO2 API PayloadFactory mediator XML array to JSON array

好久不见. 提交于 2019-12-08 05:13:26

Since you are directly mapping the xml element to a json element (not changing the structure), you can simply change the content-type of the message in the sequence and api manager (esb in api manager) will automatically convert the xml to json message for your. You won't have to use the iterate or payload factory mediator

<sequence xmlns="http://ws.apache.org/ns/synapse"  name="xml_to_json_out_message">      
    <property name="messageType" value="application/json" scope="axis2"/>
</sequence>

This will convert the xml to json

After intensive searching for an answer, I didn't find any examples that related to my problem. I now use a class mediator written in Java. Tis is not only more flexible, but also easier to debug.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!