Previously I wrote an article on how to convert between SOAP XML to REST JSON object and vice-versa. In short it was using a simple logic as shown:

— If XML is valid then will be converted to JSON 

if XMLInput <> ‘’ then 
    SET OutputRoot.JSON.Data = InputRoot.XMLNSC; 
end if; 
— If JSON is valid then will be converted to XML 
if JSONInput <> ‘’ then 
    SET OutputRoot.XMLNSC.Root = InputRoot.JSON.Data; 
end if;

How to convert between JSON and XML in IBM Integration Bus

Converting between message formats is one of the main features of an integration software. The need for this is because…

medium.com

The problem with that conversion is that if I pass an xml list as an input, it will return me a JSON object with multiple key value pairs of the same name. It isn’t equal to JSON Array and the JSON string that is returned isn’t even a valid JSON object. So in this tutorial, I am creating a wrapper function to create a JSON Array from XML List.

#xml #esql #ibm-app-connect #ibm #json-array #json

How to convert XML List to JSON Array in IIB (App Connect Enterprise toolkit) using ESQL
26.30 GEEK