How can I transform an incoming SOAP response into a JSON document using WSO2 ESB 4.0.3?

梦想与她 提交于 2019-12-11 15:09:26

问题


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?

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).

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...

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/9311517/how-can-i-transform-an-incoming-soap-response-into-a-json-document-using-wso2-es

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