SOAP to REST API - XML to jSON transformation issue

api-console-response.txtI created an API proxy using my WSDL with Apigee's SOAP to REST option. While the backend returns the XML response, the converted JSON still has XML syntax.

I noticed that the < and > signs in the XML are getting converted to & lt; and & gt; when I did a trace. Below is the proxy url, can someone tell me what I could be doing wrong?

http://nagashreeb-test.apigee.net/supercrews/tickerdata_generic

Solved Solved
0 2 2,729
2 ACCEPTED SOLUTIONS

Not applicable

The response that you attached is different from what I got when I tried your API. I didn't see the particular problem you were mentioning. Did you make any changes recently?

View solution in original post

Yes, I resolved the problem by using a javascript callout with the code below and then did a XML to JSON transformation, so looks like my backend xml response itself had the xml snippet like a string.

var result = response.content.asXML;

response.headers['Content-Type']='application/xml';

response.body = result;

View solution in original post

2 REPLIES 2

Not applicable

The response that you attached is different from what I got when I tried your API. I didn't see the particular problem you were mentioning. Did you make any changes recently?

Yes, I resolved the problem by using a javascript callout with the code below and then did a XML to JSON transformation, so looks like my backend xml response itself had the xml snippet like a string.

var result = response.content.asXML;

response.headers['Content-Type']='application/xml';

response.body = result;