Skip to Content
0
May 23, 2020 at 02:43 PM

Return XML response to Json format B1if 2.0

382 Views Last edit May 23, 2020 at 02:55 PM 2 rev

Hi All,

Please I need a way to return an xml response to its equivalent json format in B1if 2.0.

I know this is possible in B1if 1.0 but I am finding it difficult to achieve the same in 2.0

I am making a get call to BusinessPartner B1SL adapter via HTTP. The response is in xml but I want it to return json. Please kindly assist.

All of the solutions I have seen so far have NOT been helpful for 2.0

Reponse in XML

<?xml version="1.0" encoding="UTF-8"?> <Customers> <Customer> <CardCode>TEST01</CardCode> <CardName>Multichoice</CardName> </Customer> <Customer> <CardCode>TEST01</CardCode> <CardName>Discovery</CardName> </Customer> </Customers>

Json Response needed:

{ "Customers": [ { "CardCode": "DST001", "CardName": "Multichoice DSTV" }, { "CardCode": "DIS001", "CardName": "Discovery Insurance" } ] }

Thanks