Sample Code for XML-to-JSON and JSON-to-XML Conversion

 import PT_INTEGRATION:CIRESTDefinition;


Local PT_INTEGRATION:CIRESTDefinition &oConvert = create PT_INTEGRATION:CIRESTDefinition();

Local string &sJSON, &sXML;

Local XmlDoc &xmlDoc, &retXmlDoc;


&sXML = GetHTMLText(HTML.XPPHTMLX);

&xmlDoc = CreateXmlDoc(&sXML);

&sJSON = &oConvert.convertXMLtoJSON(&xmlDoc);

WinMessage(&sJSON, 64);

REM XPPJSONX - create an HTML object and paste the JSON from above into this HTML so that it can be compared with the original XML;

&retXmlDoc = &oConvert.convertJSONtoXML(GetHTMLText(HTML.XPPJSONX));

WinMessage(&retXmlDoc.GenFormattedXmlString(), 64);

PeopleCode to retrieve Google map between two addresses

  PeopleCode Example: /* Define constants for the API request */ Local string &origin = "123 Main St, Anytown, USA";   /* ...