Tools, FAQ, Tutorials:
'xml-to-json' Policy Statement
How to use "xml-to-json" Azure API Policy Statement?
✍: FYIcenter.com
The "xml-to-json" Policy Statement allows you to convert
the body of the inbound request or outbound response
from XML format to JSON format.
For example, the following "xml-to-json" policy statement converts the outbound response from XML format to JSON format.
<outbound>
<base />
<xml-to-json kind="direct" apply="always" consider-accept-header="false" />
</outbound>
Three attributes used in the above "xml-to-json" policy statement indicate:
For example, Azure receives the following XML document in the response body from the backend service:
<?xml version="1.0"?>
<soap:Envelope xmlns="http://fyicenter.com/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetOrders>
<Customer>1234567</Customer>
</GetOrders>
</soap:Body>
</soap:Envelope>
The "xml-to-json" policy statement will convert it to a JSON string:
{
"version": "1.0",
"soap$Envelope": {
"@xmlns": "http://fyicenter.com/",
"@xmlns$soap": "http://schemas.xmlsoap.org/soap/envelope/",
"soap$Body": {
"GetOrders": {
"Customer": "1234567"
}
}
}
}
Note that:
⇒ 'xml-to-json' on Invalid XML
⇐ 'find-and-replace' Policy Statement
2021-10-02, ∼7327🔥, 2💬
Popular Posts:
What is the Azure AD v1.0 OpenID Metadata Document? Azure AD v1.0 OpenID Metadata Document is an onl...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
How to view API details on the Publisher Dashboard of an Azure API Management Service? You can follo...
What is Azure API Management Developer Portal Admin? The Developer Portal Admin is an Azure Web port...
What is EPUB 3.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 3.0 Metadata "dc:publisher" ...