Skip to main content

3 replies

14-Alexandrite
October 28, 2016

Before you try anything else, change the uri from ws://127.0.0.1:8443/Thingworx/WS to wss://127.0.0.1:433/Thingworx/WS and try again. You could also try 8443 for the port (I'm using an example I have that's up-and-running; your ssl port may be configured differently.)

If that doesn't work, you probably have certificate trust problems. I run into this one every time I upgrade Java.

I see you're using a local instance. SSL is enabled with a certificate that's probably self-signed. Java isn't going to trust your self-signed certificate. When you try to make the wss (ssl) connection, it's going to refuse, because it won't trust the certificate on your local instance. You'll need to import the certificate into the list of trusted ones in your Java keystore.

Make an HTTPS connection to your local ThingWorx instance, and use the browser to get a copy of the certificate. Once you've done that, follow the steps in the following link to get Java to trust it -> Add a certificate to the Java CA store | Microsoft Azure. (It says Azure, but the instructions are broadly applicable). Once you've done that, your wss connections should go through.

1-Visitor
October 28, 2016

Thanks for your advice.

My  question is :Where to change the uri? ,as you konw , I double-click the bat,it will run.In wsiavavmstart.bat: java -jar VendingMachineSimulator.jar

In TrainingConfig.json:

{

    "ServerLocation": "127.0.0.1",

    "Port": 8443,

    "AppKey": "1c6d618d-61a7-4b29-a565-9c8ac01d6208",

    "Security": false,

    "RemoteRepo": "/ThingworxRemoteRepository"

}

In  IE explorer, I can access the webpage.

and Yes, My certificate is "self-signed",I try to import it into the list of trusted ones in Java keystore,but it still can't work.

5-Regular Member
October 28, 2016

Wei, is your platform setup for SSL? If not, please refer to this KCS article. What are the configuration options you set (on the .json file) for this simulator?

1-Visitor
October 28, 2016

Thanks .

In TrainingConfig.json:

{

    "ServerLocation": "127.0.0.1",

    "Port": 8443,

    "AppKey": "1c6d618d-61a7-4b29-a565-9c8ac01d6208",

    "Security": false,

    "RemoteRepo": "/ThingworxRemoteRepository"

}

1-Visitor
December 19, 2017

Any solution of this how to change as to wss. Same issue I am facing.

Please respond.