从WSO2 ESB 4.8 - json本机支持,信息可以在WSO2网站中找到 . 请参阅下面的博客w.r.t.json formatter&builder
http://charithaka.blogspot.co.uk/2013/10/the-difference-between-json-streaming.html
我的用例是在HTTP / 1.1 REST上使用JSON格式,这里要注意的要点是:
-
不转换ESB中的json数据(保持json格式本身在ESB中)
-
使用json格式的mediator操作json(本机支持json的mediator - script / custom mediators)
试图使用:
org.apache.axis2.json.JSONStreamBuilder
org.apache.axis2.json.JSONStreamFormatter
如Charitha博客中所述 . 现在,我没有看到json在soap消息中被转换为soap(使用Log Mediator) .
这是否意味着,WSO2 ESB 4.8不会将json请求转换为引擎盖下的SOAP,从而避免某些数据格式的数据丢失(例如,数据等,如https://github.com/erny/jsonbuilderformatter中所述)
任何人都可以分享我使用org.apache.axis2.json.JSONStreamBuilder和org.apache.axis2.json.JSONStreamFormatter(或)json的任何其他构建器和格式化程序来记录/操作json消息的示例,而无需在消息中转换为soap消息上下文 .
1 回答
正如http://docs.wso2.org/display/ESB480/JSON+Support doc中所述,从ESB 4.8开始,您必须使用以下构建器和格式化程序来保持JSON表示不变,而不必转换为XML . 这两个是ESB 4.8中的默认选项
要记录为JSON使用,
您可以使用
Payload Factory
或Script
介体操作JSON主体 . 例如─有关详细信息,请参阅documentation .