Remote thing created using Java Edge SDK always shows as not connected
Hi,
I am trying to create and bind remote thing using java edge sdk. Following is an essential part of the code:
...
| params = new ValueCollection(); | |
| params.SetStringValue("name", "MyThing"); | |
| params.SetStringValue("thingTemplateName", "RemoteThing"); | |
| client.invokeService(ThingworxEntityTypes.Resources, "EntityServices", "CreateThing", params, | |
| 0); |
| client.invokeService(ThingworxEntityTypes.Things, "MyThing", "EnableThing", params, 0); | |
| client.invokeService(ThingworxEntityTypes.Things, "MyThing", "RestartThing", | |
| params, 0); |
| params = new ValueCollection(); | |
| params.SetStringValue("name", "HelloService"); | |
| params.SetBooleanValue("remote", true); | |
| params.SetStringValue("remoteServiceName", "HelloService"); | |
| client.invokeService(ThingworxEntityTypes.Things, "MyThing", | |
| "AddServiceDefinition", params, 0); |
| VrtualThing thing = | |
| new MyThing("MyThing", "", "MyThing", client); | |
| client.bindThing(thing); |
| client.start(); |
.......
MyThing class exists and extends VirtualThing.
I can see my thing created and HelloService added to it, however its isConnected property is always false and "lastConnection" date is set to Jan 1, 1970. If I try to invoke HelloService I get "Unable to Invoke Service HelloService on MyThing : No service handler defined for service HelloService on thing [MyThing]".
What am I missing?
Thanks,
Michael

