Skip to main content
16-Pearl
February 16, 2024
Solved

Unable to execute the service from thingworx to Vuforia Studio

  • February 16, 2024
  • 1 reply
  • 1110 views

Can anyone please look at it as i want to execute this service from RESOURCES in vuforia studio but i am unable to execute it. Request is not going.

 

resource.png

 

 $timeout(() => {
 
 twx.app.fn.triggerDataService("CurrentSessionInfo", "GetCurrentUserExtensionProperties");
 }, 100);

 $scope.$on("GetCurrentUserExtensionProperties.serviceInvokeComplete", function (evt, arg) {
 let result = $scope.app.mdl["CurrentSessionInfo"].svc["GetCurrentUserExtensionProperties"].data;
 
 console.log("Jamal Ashraf"+result);
 /* var userNames = [];

 for (var i = 0; i < result.array.length; i++) {
 userNames.push({ "value": result.array[i].value });
 console.log(result.array[i].value);
 }*/

 // $scope.view.wdg["select-1"].list = userNames;
 });

 

 

Best answer by MA8731174

I got the solution but thats strange because service itself does not have any parameter in thingworx but it needs parameter to run as below you can see:

 var params = {"type":"Things"};
 twx.app.fn.triggerDataService("CurrentSessionInfo", "GetCurrentUserExtensionProperties",params);
 
 }, 100);

now it is working fine as expected. 

 

$scope.$on("GetCurrentUserExtensionProperties.serviceInvokeComplete", function (evt, arg) {
 
 let result = $scope.app.mdl["CurrentSessionInfo"].svc["GetCurrentUserExtensionProperties"].data.current.description;
 
 $scope.app.params.userName=result;
 
 console.log("The user"+ result +" is loggedIn!");
 

 });

1 reply

MA873117416-PearlAuthorAnswer
16-Pearl
February 16, 2024

I got the solution but thats strange because service itself does not have any parameter in thingworx but it needs parameter to run as below you can see:

 var params = {"type":"Things"};
 twx.app.fn.triggerDataService("CurrentSessionInfo", "GetCurrentUserExtensionProperties",params);
 
 }, 100);

now it is working fine as expected. 

 

$scope.$on("GetCurrentUserExtensionProperties.serviceInvokeComplete", function (evt, arg) {
 
 let result = $scope.app.mdl["CurrentSessionInfo"].svc["GetCurrentUserExtensionProperties"].data.current.description;
 
 $scope.app.params.userName=result;
 
 console.log("The user"+ result +" is loggedIn!");
 

 });
21-Topaz I
February 27, 2024

sure that empty param will not work? - so at least it should be a json when ever it could be empty when not arugment required

var params = {};

 - so think issue form Vuforia side not form thingworx