Sending Data from Vuforia Studio to ThingWorx – Service Execution Problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sending Data from Vuforia Studio to ThingWorx – Service Execution Problem
Issue Overview
We are facing a critical issue in our ThingWorx-Vuforia Studio setup when sending requests to the AddQualityStepData service in thingworx from vuforia studio. The service is triggered from four mobile devices by our customer. Under normal conditions, when the request fails, an Ionic popup appears, notifying the user that the service did not execute successfully and allowing them to retry.
However, sometimes the request does not show an error, nor does it complete execution—it simply freezes the app. The Ionic popup does not appear, and the mobile application becomes unresponsive until the customer manually restarts it. After restarting, the app starts working normally again.
What I Have Tried So Far
Spinner Implementation:
I implemented a loading spinner that runs until the AddQualityStepData service completes.
I noticed that every 1-2 days, the spinner keeps running indefinitely, which indicates that the service never fully executes.
If the service failed properly, the Ionic popup would appear—but in this case, it does not.
Potential Causes I Am Considering:
Internet Connection Issues: Could a weak internet connection cause the service call to get stuck without failing?
ThingWorx Overload: Since multiple mobile devices are calling the same service, could ThingWorx be overloaded and failing to execute the service?
Uncaught Errors: Is there a scenario where ThingWorx does not return a response at all (neither success nor failure), causing Vuforia Studio to freeze?
$scope.sendPartReport = function() {
twx.app.fn.triggerDataService("Test.StudioMobile.Controller", "AddQualityStepData", {
"serialNumber": xxxx,
"metadata": xxx,
"stepNumber": stepCount+1,
"userIdentification": xxxx,
"qualityCheckTimestamp" : xxxx,
"productCategory": xxxxx,
"lineName": xxxx,
"lineLocation": xxx,
"shippingNumber": "1223",
"customerSerialNumber": "Z123543-222"
});
console.log("$scope.sendPartReport: Report sent");
};
// Handling Service Failure – Shows Ionic Popup
$scope.$on('AddQualityStepData.serviceFailure', function(evt, arg){
console.log("AddQualityStepData.serviceFailure:", arg);
$ionicPopup.show({
title: "Error",
template: "There was a problem sending request Please try again!",
scope: $scope,
buttons: [{
text: '<b>Send Again</b>',
type: 'button-positive',
onTap: function() {
$scope.sendPartReport();
}
}]
});
});
Observations & Questions
Since our customers are reporting this problem frequently, any insights or troubleshooting steps would be greatly appreciated. Has anyone faced a similar issue with ThingWorx services hanging instead of returning an error?
Thanks in advance for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you suspect that the TWX service is the issue, why not put logging into it on TWX side?
Can multiple calls overload it? Possible, it depends on what it does. But you can test that by calling the service multiple times?
If you don't need the result of the service you can also try to make it async so there is no need to wait.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for your response! The service is running on production, and we have multiple projects running on the same environment. The issue occurs randomly at any given time, making it hard to pinpoint.
Regarding logging, since there are many logs being generated across various services, it’s difficult to efficiently track the specific logs related to this issue. Do you have any suggestions on how to efficiently filter logs or maybe set up targeted logging just for this service to catch when it fails?
Additionally, this service adds data into a DataTable. It first checks who is logged in and whether they have the right permissions to view this datatable and also there exists two if statements which create dataset with datatable dynamically but its just for first time and did not execute afterwards. So If the right user has on dataset then, it adds the data to the DataTable—but the service does not return anything back to the client.
Given this behavior, how would you suggest testing the service by calling it multiple times? Since it doesn’t return a response, what would be the best way to measure whether it is failing or getting stuck?
About Async I will try it also because at the moment the service is not async....
This is just one example from a few projects. Some projects don’t use this specific service and have their own custom services, yet the system still becomes very slow at times. Additionally, in some cases, users upload images from their phones to ThingWorx, and that process also experiences slowdowns.
This issue is not difficult to notice but is very hard to trace or diagnose. There’s no clear pattern or specific trigger—it just suddenly makes the entire system very slow, and we can't pinpoint why this behavior occurs. Any suggestions on how to efficiently monitor or debug this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You said the customer reports the issue frequently so it shouldn't be that hard to reproduce.
Put in logging at the start of the service and at the end. Put a keyword into the log message and use that for filtering.
Have a try-catch block to avoid exceptions. Exceptions are visible in the application log. There you can see if a service failed.
First step is to locate the issue. Is it TWX, is it Vuforia, or is it the infrastructure?
If you have it in production, you should have it in QA. If you don't, find the difference between Prod and QA.
If you do, in QA, replace the service implementation with a dummy and see if the error still occurs.
You can setup monitoring to see what happens on the platform when the issue occurs.
You can try running against a service with an exception or a timeout on purpose to see how the system behaves and handle that in Vuforia.
