Skip to main content

Convert between XML/JSON in Logic Apps workflows with the XML-JSON Converter

motivation

To run simple XML/JSON transformations, the built-in Logic Apps expressions json and xml do the job fine. When using custom mapping, selection, or structures, the built-in expressions might be too complex to set up.

Invictus provides a XML/JSON Converter component which converts XML/JSON contents, while running a XSLT transformation beforehand (stored in Azure Blob Storage). Removing the complexity from the Logic App

Available endpoints

  • /api/XmlToJson: transforms incoming request with XML contents to a response with the JSON result.
  • /api/JsonToXml: transforms incoming request with JSON contents to a response with the XML result.

The /api/XmlToJson endpoint transforms a provided BASE 64-encoded XML contents to a BASE 64-encoded JSON result. A XSLT transformation (stored in the Azure Blob Storage container called xmltojsonconfigstore) gets run beforehand to map the request in the right structure. This stored transformation gets referenced in the request.

Request propertyRequiredDescription
ContentyesThe BASE 64-encoded XML contents.
ConfigNameyesThe file name of the XSLT transformation, stored in Azure Blob Storage.
ContextnoThe dictionary providing context to the conversion, gets copied 1:1 to the response.
XPathnoThe XPath expression that selects a specific XML node before the XSLT transformation.
JPathnoThe JPath expression that selects a specific JSON property after the XSLT transformation.
Full request JSON body example
// POST /api/XmlToJson
{
"Content": "eyJFbnZlbG9wZSI6IHiU2FsZXNPcmRlckluIjp7ICAgICAgICAg...." ,
"ConfigName":"IDD038-inbound.xsl",
"XPath": "/CustomerAccount/Message",
"JPath": "$.Envelope",
"Context": {
"x-conversationId": "29500405-d7cf-4877-a72b-a3288cff9dc0"
}
}
Full response JSON body example
// 200 OK <- /api/XmlToJson
{
"Content": "ejHixZlwI9HiU2FsxNPcmRluIjp7ICAgICagICa...",
"Context": {
"x-conversationId": "29500405-d7cf-4877-a72b-a3288cff9dc0"
}
}

Showing 4 parameters
NameDescriptionTags
invictusXmlJsonConverterFunctionLocalContainerImage

The URL that navigates to the Azure Container App image of the XML-JSON Converter component.

comp:xml-json-convertercontainer-apps
storageAccountName
default: invictus${resourcePrefix}store

The name of the shared Azure Storage Account, used by all Framework components.

comp:pubsubcomp:transcocomp:regex-translatorcomp:xsd-validatorcomp:xml-json-convertercomp:time-sequencercomp:sequence-controllerstorage
xmlJsonConverterFunctionName
default: inv-${resourcePrefix}-xmljsonconverter

The name of the Azure Container App deployed for the XML-JSON Converter component.

comp:xml-json-convertercontainer-apps