cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Unable to execute the service from thingworx to Vuforia Studio

MA8731174
14-Alexandrite

Unable to execute the service from thingworx to Vuforia Studio

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;
  });

 

 

ACCEPTED SOLUTION

Accepted Solutions
MA8731174
14-Alexandrite
(To: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!");
   

  });

View solution in original post

2 REPLIES 2
MA8731174
14-Alexandrite
(To: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!");
   

  });

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

Announcements

Top Tags