Szilard Barany
Szilard Barany

Reputation: 1135

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

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

Upvotes: 0

Views: 2559

Answers (1)

keheliya
keheliya

Reputation: 2553

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.

Upvotes: 1

Related Questions