Tools, FAQ, Tutorials:
'xml-to-json' on Invalid XML
What will happen if "xml-to-json" policy statement is applied on an invalid XML document?
✍: FYIcenter.com
If you apply the "xml-to-json" policy statement on the request
or response body that has an invalid XML document,
you will not receive any errors.
What you will get is a string that looks like a corrupted XML document.
For example, client is sending the following request body with an invalid XML:
<?xml version="1.0"?> <soap:Envelope xmlns="http://fyicenter.com/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetOrders> <Customer>John & Sons</Customer> </GetOrders> </soap:Body> </soap:Envelope>
The "xml-to-json" policy statement will convert it to the following string:
<< ? xml version = "1.0" ? > < soap : Envelope xmlns = "http://fyicenter.com/" xmlns: soap = "http://schemas.xmlsoap.org/soap/envelope/" > < soap: Body > < GetOrders > < Customer > John & Sons < /Customer> < /GetOrders> < /soap:Body> < /soap:Envelope>
The root cause is the & sign that is not encoded as an XML entity in the request body.
Â
⇒ 'json-to-xml' Azure API Policy Statement
⇠'xml-to-json' Policy Statement
2017-11-12, 1375👍, 0💬
Popular Posts:
Where to see resource detailed information of my API Management Service on Azure Portal? Once you ha...
How to Instantiate Chaincode on BYFN Channel? You can follow this tutorial to Instantiate Chaincode ...
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value mul...
How to access URL template parameters from "context.Request.Matched Parameters"object in Azure API P...
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...