NEWBIE::Why does this service return a INFOTable within the test in Thingworx, but any external calls to return an empty object or string?
try {
var devices = Things['ATS.Org'].ListDevices();
var device;
result = null;
//logger.warn(devices)
for each(device in devices.rows) {
device = Things[device.EntityName];
if (device.GetLastModifiedDate() > lastDTSCheck) {
if (result == null) {
logger.warn("Result is null");
result = Things[device.name].GetPropertyValues();
result.name = device.name;
} else {
logger.warn("Got a Result");
result.AddRow(Things[device.name].GetPropertyValues().rows[0]);
result.rows[result.getRowCount() - 1].name = device.name;
}
}
}
// I have tried each of these conversions as a means for returning the result object
// for an external request ( HTTPie, Postman, Curl, etc) and always get
//
// b'{"dataShape":{"fieldDefinitions":{}},"rows":[]}'
//
//logger.warn("debugging the output? ..... " + result);
//logger.warn("debugging the output 2 as json string" + result.ToJSON() );
//logger.warn("debugging the output 3 as stringify: " + JSON.stringify(result) );
//logger.warn("debugging the output 4 as toString: " + result.toString() );
//result = result.toJSON();
result
} catch (err) {
logger.warn(me.name + ".MEB() [err]: " + err + ", " + err.lineNumber);
}

