ThingWorx Edge Java SDK > Using ThingWorx Platform and the Edge Java SDK > Running the SimpleClient Application
  
Running the SimpleClient Application
Now that you know how the Simple Client application connects, reads and writes properties, invokes services, and fires events, you can run it. To run this example application, you must have followed the instructions for installing Gradle in Setting Up to Run Sample Applications.
The example application expects a Remote Thing called SimpleThing_1 to be present on your ThingWorx Platform. So that you do not need to create it, the entity file, entities/ExampleExport.xml, is provided in your distribution for you to import to your server. In addition, you need to edit the SimpleThing.java source file. In particular, you need to change the URI for the server to match the URI for your server and replace the AppKey placeholder with an application key that exists on your server.
Follow these steps to edit the source file and run the sample application:
1. From ThingWorx Composer:
a. Create SimpleThing_1 by importing the entity file resources/ExampleExport.xml, into your server.
b. Either obtain an existing or generate a new AppKey to use with the sample application. You will need it while editing the sample source file.
2. From your IDE, open the sample source file, samples/src/com/thingworx/sdk/simple/SimpleClient.java.
3. Locate the following line:

config.setUri("wss://localhost:443/Thingworx/WS");
4. Edit this line as follows:
a. If you are not using SSL/TLS, change wss: to ws: (at the beginning of the URI).
b. Change localhost in this line to the IP address of your server.
c. Change the port number in the URI to match the one for accessing your server. For example, if you are running the ThingWorx Platform locally without HTTPS, you would use
config.setUri("ws://localhost:8080/Thingworx/WS");
5. Locate the following line:

config.setAppKey("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
where the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx represents the format of an application key.
6. Replace the AppKey placeholder with the one from your platform.
7. Save your changes.
8. From the samples/ directory, run this example, using this command:
gradle SimpleClient