Skip to main content
Jul 11, 2018 5:53 AM UTC
Solved

Import Thing's service into eclipse

Hi All,

I have scenario like,

Thing "TestThing" created in Thingworx with GenericThing Template. Also created a service called "TestService".

Now, in parallel I'm developing an extension on eclipse. 

I want to use or call "TestService" on extension.

How can I achieve this?

 

Thanks & Regards,

Sathishkumar C

Jul 11, 2018 3:31 PM UTC
Thing targetThing = ThingUtilities.findThing("YourThingName");
targetThing.processServiceRequest(serviceName, new ValueCollection());

 

You can use ThingUtilities to find your Thingn, and invoke this service like presented above.

ValueCollection is responsible for puttig parameters for you service. If you don't need parameters you can leave it like above.

 

This service is returning InfoTable with output.

1 reply

Jul 11, 2018 3:31 PM UTC
Thing targetThing = ThingUtilities.findThing("YourThingName");
targetThing.processServiceRequest(serviceName, new ValueCollection());

 

You can use ThingUtilities to find your Thingn, and invoke this service like presented above.

ValueCollection is responsible for puttig parameters for you service. If you don't need parameters you can leave it like above.

 

This service is returning InfoTable with output.