Skip to main content
17-Peridot
July 11, 2018
Solved

Import Thing's service into eclipse

  • July 11, 2018
  • 1 reply
  • 1603 views

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

Best answer by A_Macierzynski
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

15-Moonstone
July 11, 2018
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.