Forum

Mathieu Roll
Keymaster
    Has successfully completed the online course Introduction
    Has successfully completed the online course Intermediate (200)
    Has successfully completed the online course Advanced (300)
    Has successfully completed the online course Basics (100)
6 years, 5 months ago #16545
Up
0
Down
::

Hello,

 

yes you need to decode the data.

the best way to do this is using a business object.

Please find attached an example how to do this.

// read xml with connector
var result = Simplifier.Connector.TestXML.getXML().result;
output.result = result;

//convert RESTTextResult(xml) to javascript object

//convert xml to json
var RESTTextResultJSON = Simplifier.Util.xml2json(result.RESTTextResult);
//parse json to javascript object
var RESTTextResult = JSON.parse(RESTTextResultJSON);
//output data
output.RESTTextResult = RESTTextResult;

//convert RESTBinaryResult(base64) to javascript object

//convert base64 to xml
RESTBinaryResultXML = Simplifier.Util.decodeBase64(result.RESTBinaryResult);
//convert xml to json
var RESTBinaryResultJSON = Simplifier.Util.xml2json(RESTBinaryResultXML);
//parse json to javascript object
var RESTBinaryResult = JSON.parse(RESTBinaryResultJSON);
//output data
output.RESTBinaryResult = RESTBinaryResult;