3将传入的SOAP响应转换为JSON文档

3将传入的SOAP响应转换为JSON文档

本文介绍了如何使用WSO2 ESB 4.0.3将传入的SOAP响应转换为JSON文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用WSO2 ESB 4.0.3将SOAP响应主体转换为JSON.我找到了信息关于如何为JSON配置ESB的信息,但是那又是什么呢?

I would like to transform the SOAP response body to JSON using WSO2 ESB 4.0.3. I found info on how to configure the ESB for JSON but then what?

换句话说;我想拥有/创建一个将输入的SOAP/XML响应转换为JSON的转换介体(实际上也最好有一个JSON2XML转换介体).

To put it differently; I would like to have/create a transform mediator that transforms incoming SOAP/XML response into JSON (and actually it woudl be good to have a JSON2XML transform mediator too).

我应该以Groovy脚本中介者还是Java类中介者的身份进行开发?最好的办法是将它与ESB预先包装在一起,因为它说它支持JSON和格式转换...

Should I develop is as a Groovy script mediator or Java class mediator? The best would be to have it pre-packaged with the ESB as it says it supports JSON and format transformations...

谢谢

推荐答案

您可以使用XSLT转换来做到这一点.请参阅示例.它显示了如何将JSON转换为SOAP请求并转发到Axis2服务器.然后,来自Axis2服务器的SOAP响应将转换为JSON消息并发送回去.如前所述,您必须配置ESB以支持JSON,例如.

You can use a XSLT transform to do that. See this sample. It shows how to transform a JSON into a SOAP request and forward to the Axis2 server. Then the SOAP response from the Axis2 server will be converted into a JSON message and sent back. Before that, as you mentioned, you will have to configure ESB to support JSON like this.

这篇关于如何使用WSO2 ESB 4.0.3将传入的SOAP响应转换为JSON文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 04:04