How to convert json format into the xml format.

Hi Everyone,

 

I'm getting the data in JSON format from the source system using API connection point.

How can i convert JSON response as xml format to send to the target system.

Kindly suggest.

 

Regards

Satish

  • Hi Satish,
    can you please describe a bit more, what you are trying to achieve? Maybe getting data from a web API and then do what? Create a BOD or what is the goal? What technologies are you using for getting the Json and what is the destination of the XML?

    Regards,
    Marc
  • In reply to Marc Schrod:

    Hi Marc thank you for swift response.

    I'm trying to fetch the data from one system using ION API connection point in json format, and want send that data/json data to an ERP application as bod(i mean in xml format).

    Regards
    Satish
  • In reply to 1753258:

    Hi Satish,
    still not 100% clear for me, but I explain you what I have done, maybe this helps.

    I am currently connecting the PIM system Akeneo to ION and LN. The conneciton to Akeneo is implemented by using SQL Server 2017 with SSIS. Inside SSIS I am pulling data from Akeneo via the Webservice API provided by Akeneo. The results are coming in Json format. That Json is then converted into XML BODs also using SQL Server/ SQL+SSIS. SQL Server 2017 is supporting Json and XML handling natively but there is an issue with UTF8 compatibility (you need a workaround with a SSIS script component) that should disappear with SQL Server 2019.
    If any of those technologies mentioned fit to your environment, then let me know and I might help, but if not then you should explain a bit more about what you are achieving.

    Best regards,
    Marc
  • In reply to Marc Schrod:

    Hi Marc,

    The Integration between Sales force and XA platfrom. I used to get the data from SF using ION API connection point in JSON format and i have to send it to XA ERP application as a bod, then how can i proceed further

    Regards
    Satish
  • In reply to 1753258:

    Hi Satish,
    you could map the Json outcome using a XSLT tranformation (e.g. created by Altova Mapforce) to the destination BOD XML structure (the XSLT is available in the ION mappings). Inside that mapping you can also do some business logic or map e.g. specific codes (e.g. business partner type, product lines, payment terms etc.). Are you familiar with XSLT? Have you used that functionality in ION before?

    Regards,
    Marc
  • In reply to Marc Schrod:

    Thanks for your inputs Marc.

    I have experienced in writing XSLT mappings for xml in notepad manually. But didn't write mappings for JSNO to XML.
    Altova Mapforce is proprietary software right , Is there any Opensource mapping tools are available ?
    I'll try Marc.



    Regards
    Satish
  • In reply to 1753258:

    Hi Satish,

    no sorry, I do not know any Opensource and would also need to investigate. But maybe other members of ths forum could suggest anything ?! Hey guys and ladies - give us a hint! ;-)
  • In reply to Marc Schrod:

    HI Everyone,

    @Marc Schrod, 

    I need further discussion in the forum it seems.

    Source system is sending data in JSON format using ION API.

    Target system is expecting XML format, ERP Application.

    In Mapping, For bods type only we can do the Graphical mapping or Sensitive mapping(Please find the below reference screen shot).

    There is no option of JSON to XML mapping in Infor OS.(Please check in the mapping option once.)

    Might be we need manual mapping here it seems.

     

    Can any one suggest me, how can i proceed further ?

     

    Please find the below references.

     

     

  • In reply to 1753258:

    Did you check the standard Output options in IONAPI connector? See the various formats available in the IONAPI connector in the Technology connector guide ->https://www.inforxtreme.com/esknowbase/root/DLPublic/50436/ion_12.0.x_iontechconceag_cloud_en-us.pdf -> Page 99. If the API returns an JSON and you simply want to convert that to a BOD, Then you should be able to do it automatically. Select the Output BOD document first. Usually such BODs will be a custom BOD, so you can also use the "Generate Metadata option" to generate schema for your custom BOD. This custom BOD will be based on the following steps:
    1. Your JSON will be internally converted to an corresponding XML.
    2. This XML will then form the Noun part of the DataArea of your custom BOD.

    If you don't want an automatic wrapping, but want to control the output BOD according to your needs, you can also do in place hard coded XML or JSON output and substitute the values from the response using the $IonApiRef xpath addressal by choosing "Map API response to the document" option. 

    Subsequently you have to select the output format as "BOD from JSON".

    This should automatically convert your JSON output to a (custom) BOD of your choice. Hope this helps.  

     

  • In reply to Vignesh:

    Thanks Vignesh,

    Yes your correct, there is auto conversion feature is available in ION API connection point, the thing is if schema is not available then we have to provide the noun name and select the type as bod in Generate metadata.

    Previously i have gone through this documentation but while implementation i failed.
    I felt the document bit clumsy and tried multiple ways finally i got the response as bod(xml) format.


    Regards
    Satish
  • In reply to 1753258:

    Moved to ION Connect Forum