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.
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?
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 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.
my friend, I add self-signed certificate to the list ,as bellows,but the endpoint still can't access .