Hi,
I am not able to extract service callout response variables in node.js:
Used following in my node js:
var svr = http.createServer(function(req, resp) {
console.log(“insidefunction”);
var testVariable = apigee.getVariable(req,‘sample’);
console.log("testVariable ", testVariable);
var abc = JSON.stringify(testVariable);
console.log(“info abc235”, abc);
var testVariable1 = {};
testVariable1=JSON.parse(abc);
console.log(“info testVariable1”, testVariable1); //console.log(‘sampleVar2212342’,JSON.stringify(testVariable));*/ //var testVariable1 = JSON.parse(testVariable);
console.log('cust212 ',testVariable1.customerInfo.customer);
console.log('customerI2 ',‘Hello, Node!’);
resp.end(‘Hello, Node!’); });
console.log('cus ',‘Hello,’);
svr.listen(process.env.PORT || 8000, function() { console.log(‘Node HTTP server is listening’); });
not able to extract testVariable1.customerInfo and further , though it is been parsed as json object and in console log i am getting it printed , but on the next line if we extract the variable it is giving undefined.
