How to show output of java file to Thingworx
I have a program written in java and i want to display its output in Thingworx.
Can anybody please suggest is there any way to implement this???
I have a program written in java and i want to display its output in Thingworx.
Can anybody please suggest is there any way to implement this???
I have worked on the java connection with thingworx and i have done it through java edge sdk and it works perfectly.
Try below:
declare below constructor:
public classname(ClientConfigurator config) throws Exception {
super(config);
}
use below code:
ClientConfigurator config = new ClientConfigurator();
config.setUri("ws://ipaddr:port/Thingworx/WS");
config.ignoreSSLErrors(true);
config.setAppKey("applicationKey"); //application Key which you have created in thingworx
classname client = new classname(config);
client.start();
InfoTable result;
//Declaer values to input in service
ValueCollection params = new ValueCollection();
params.put("maxItems", new IntegerPrimitive());
//create service in data tabe if you want to fetch data in it and use it in invoke service
//To read all the values from the Data table of Thingworx with things
result = client.invokeService(ThingworxEntityTypes.Things, "thingname", "servicename", params, 5000);
To update in data table:
ValueCollection value = new ValueCollection();
value.SetStringValue("Status", status); // field you want to give input in service
client.invokeService(ThingworxEntityTypes.Things, "datatablename", "servicename", value, 5000);
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.