Java SDK: Get property values from Windows Powershell
I have put together a small sample of how to get property values from a Windows Powershell command into Thingworx through an agent using the Java SDK.
In order to use this you need to import entities from ExampleExport.xml and then run SteamSensorClient.java passing in the parameters shown in run-configuration.txt (URL, port and AppKey must be adapted for your system). ExampleExport.xml is a sample file distributed with the Java SDK which I’ve also included in the zipfile attached to this post. You need to go in Thingworx Composer to Import/Export … Import from File … Entities … Single File … Choose File … Import.
Further instructions / details are given in this short video:
Re: Java SDK: Get property values from Windows Powershell
At 2:51 mins in the video I said “Application ID” but the correct term is “AppKey”. This allows the device to provide credentials which give permissions based on a user. In Thingworx Composer you can go to Security … Application Keys and generate an AppKey tied to a user ID. You will also need to define an Expiration Date otherwise I think it will default to 1 day only.
So you will need to replace the values in bold above with values relevant to your system: serverName, port, AppKey. Just for info the numbers at the end (1000 1 10) control the demo program’s behaviour – incl. how many demo things it creates.
The URL above is using unencrypted web sockets which I assume is OK for your system but possibly you’ll need to use encryption (so wss:// )