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

Java sdk : EnableThing and RestartThing services not behaving correctly

SOLVED
vaishnavee
Amethyst

Java sdk : EnableThing and RestartThing services not behaving correctly

Hi,

 

I am using the Java sdk to connect to the TW server via ConnectedThingsClient. I need to dynamically create Things, and add properties to them. For this I'm doing -

 

client.invokeService(Resources, "EntityServices", "CreateThing", inputCollection, 3000);
client.invokeService(Things, "EnableThing", "<thingName>", new Vc(), 3000);
client.invokeService(Things, "RestartThing", "<thingName>", new Vc(), 3000); 

The enableThing  service call returns an infotable with row containing enabled = false. Even after the restart call, the thing is still disabled. I have tried to restart the client connection in between 2nd and 3rd invoke call.

 

If I do the same set of actions via REST apis, for the same credentials, it works. 

 

What might be going wrong with the java calls? Any pointers will be appreciated!

 

Regards,

Vaishnavee

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Java sdk : EnableThing and RestartThing services not behaving correctly

There was some mistake while passing the service name to the invokeService call. I had assigned wrong service name to the varibles instead of EnableThing.

Dropping this issue.

View solution in original post

3 REPLIES 3

Re: Java sdk : EnableThing and RestartThing services not behaving correctly

Can you try to wrap EntityServices + EnableThing + RestartThing in a single platform service (with proper exception handling) and invoke this service from Java Edge SDK ?

 

Regards.

Re: Java sdk : EnableThing and RestartThing services not behaving correctly

Thank you for the reply @smainente , i just posted an update;  apparently i had mis-initialized the variables. 

Tags (1)

Re: Java sdk : EnableThing and RestartThing services not behaving correctly

There was some mistake while passing the service name to the invokeService call. I had assigned wrong service name to the varibles instead of EnableThing.

Dropping this issue.

View solution in original post

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.