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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Remote service not returning any value

rkandasamy
7-Bedrock

Remote service not returning any value

We have a Data Change Event associated with the isConnected property. As soon as the value of isConnected becomes true we call a remote service on the SDK. This remote service on the SDK will always return the value as true(BOOLEAN).

The remote service on the SDK executes properly. However the control does not flow back to the Subscription present in the TW Server. Please note that this event and the subscription is getting triggered properly. The only problem is we are not able to fetch the value returned from the SDK. We are using JAVA SDK to connect to the TW Server.

Please let us know how can we fix the issue.

Below is skeleton of Subscription :

if(isConnected == true)

{

     //call remote service on sdk

     var result = me.checkIsConnected("test");  ---> control does not come back here after executing remote service on SDK

}

Below is skeleton of SDK :

@ThingworxServiceDefinition(name = "checkIsConnected", description = "send data to sdk")

@ThingworxServiceResult(name = CommonPropertyNames.PROP_RESULT, description = "Result", baseType = "BOOLEAN")

public bool checkIsConnected(@ThingworxServiceParameter(name = "test", description = "Value 1", baseType = "STRING") String str)

throws Exception {

log.info("\nService Start "+ str  );

try {

//called thingworx service to get data

} catch (Exception e) {

log.error("Error while processing the request ", e);

}

log.info("Ending remote method+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");

return true;

}

0 REPLIES 0
Announcements


Top Tags