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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Unable to execute the service from thingworx to Vuforia Studio

Jamal8548
10-Marble

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

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

Top Tags