Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hello, I'm trying to write a service that allows me to push a Kepware configuration (in .json format) to a chosen Kepware server.
When I try to push the configuration using the "PushConfigToEdge" built in service, I get "Configuration Transfer from ThingWorx Platform failed. | Reason = 'Access Denied'" on the Kepware interface. I've also tried using the built in push/pull interface from the Thing -> Configuration Files page, but I get the same result.
What am I doing wrong? Below you can find the source code I'm using at the moment.
Thanks in advance.
var fileNameExt = fileName + ".json";
var tempString = jsonString;
tempString = "'" + jsonString + "'";
tempString = JSON.stringify(tempString);
pause(10000);
var tempObj = JSON.parse(tempString);
pause(10000);
Things["SystemRepository"].SaveText({
path: '/' + fileNameExt /* STRING */,
content: tempObj /* STRING */
});
Things[gatewayName].PushConfigToEdge({
sourceFileName: fileNameExt /* STRING */,
filePassword: undefined /* STRING */,
sourcePath: '/' /* STRING */
});
Solved! Go to Solution.
hi @aiGreek ,Configuration Utility needs to be closed before this function will work properly from TW.
hi @aiGreek ,Configuration Utility needs to be closed before this function will work properly from TW.
Thank you @anarwal, I would have never figured that out by myself! Now I'll need to add some form of logging since I can't check the results via the config utility, but that's another matter.