Skip to main content
1-Visitor
June 11, 2018
Solved

Unable to connect with .NET SDK to Thingworx

  • June 11, 2018
  • 2 replies
  • 2620 views

Hi there,

 

I have searched similar issues and I can´t resolve my issue.

 

I have a trial account of ThingWorx and I want to test .NET sample but I can´t connect to ThingWorx.

First I created SteamSensor1, SteamSensor2 and SteamSensorAppKey in the composer.

My apiUri is: https://pp-1806041235nn.devportal.ptc.io/Thingworx

Is it okay?

 

I haven´t changed the code provided in the sample. I try the sample in debug mode with Visual Studio 2017.

These are my errors:

com.thingworx.communications.client.TwApiWrapper Error: 0 : [Error] Error intializing SSL connection
com.thingworx.communications.client.TwApiWrapper Error: 0 : [Error] twWs_Connect: Error restarting socket. Error 0
Best answer by konyicska

Well finally I figured out that my API uri was the problem: 

Now my API uri is: https://PP-1806041235NN.Devportal.Ptc.Io:8080/Thingworx/WS

 

Then my Api Key has expired. To find this I had to display all errors in console. For that I changed 

<add name="SourceSwitch" value="error" />

to

<add name="SourceSwitch" value="all" />

In App.config

2 replies

5-Regular Member
June 12, 2018

@unknown

 

Thank you for posting this. See if below one helps.

https://community.ptc.com/t5/ThingWorx-Developers/Logging-with-the-NET-sdk/m-p/516231#M12395

 

Regards- Mohit

konyicska1-VisitorAuthor
1-Visitor
June 12, 2018

Well finally I figured out that my API uri was the problem, maybe.

 

Now my API uri is: https://PP-1806041235NN.Devportal.Ptc.Io:8080/Thingworx/WS

 

I haven´t any errors in my console but in Thingworx Composer SteamSensor things don´t update their isConnected property.

konyicska1-VisitorAuthorAnswer
1-Visitor
July 6, 2018

Well finally I figured out that my API uri was the problem: 

Now my API uri is: https://PP-1806041235NN.Devportal.Ptc.Io:8080/Thingworx/WS

 

Then my Api Key has expired. To find this I had to display all errors in console. For that I changed 

<add name="SourceSwitch" value="error" />

to

<add name="SourceSwitch" value="all" />

In App.config