cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

403 error trying to connect ADO Service via EMS

gmcnamara
1-Newbie

403 error trying to connect ADO Service via EMS

Hi, I'm trying to test connecting the ADO Service to ThingWorx via the Edge Microserver. ADO, EMS and ThingWorx Server are all installed on the same PC. If I configure ADO to talk direct to the Thingworx Server it connects ok. When I configure ADO to connect to EMS I get the following error in the ADO logs:

2016-07-29 23:48:18.625Z [L: Error] [T: 6] [U: SYSTEM] [O: com.thingworx.communications.client.TwApiWrapper] [Error] twWs_Connect: Error initializing web socket.  Response code: 403

This seems to correspond to this error in the EMS logs:

29T23:48:18,650","origin":"RestThingworx::callback","content":"Handling request"}

{"level":"DEBUG","timestamp":"2016-07-29T23:48:18,654","origin":"[-0700] HTTP Server","content":"1.0.0.127 - SeqId 76 - \"GET \/Thingworx\/WS HTTP\/1.1\" 403 0 \"-\"\n"}

EMS is connected to ThingWorx ok. Any ideas what I'm doing wrong?

Regards,

Greg

12 REPLIES 12

Greg, is there a reason why you are trying to connect the ADO service to the Edge Microserver? We do have a separate ADO Edge client available which you can directly use to connect/ pair your database.

Thanks Aanjan, by ADO service I mean I’m using the ThingWorx ADO Service v5.6.1.1100. I would like to route everything through an edge gateway device running EMS. In the documentation for the ADO service it mentions connecting via the EMS but I can’t get it to work. Is there a different ADO edge client I should be using? Could you please send me a link to download?

Regards,

Greg

You wouldn't need to use the EMS at all; you can just configure the AdoThing.xml to connect to your platform and your database. For the platform settings, you would need a host name, port, appKey and security (ssl) information. For the database settings, you would need the type of DB (OleDb etc) and the connection string.

On the ThingWorx platform, you would need to create a Thing and make sure the name matches the once specified in the AdoThing.xml. Here's a direct link to our ADO section on the Edge Help center which goes into more detail regarding setting up the connection.

Thanks Aanjan. I'm trying to avoid connecting the industrial PC to the internet (firewall issues) which is why I want to channel via EMS installed on a gateway hardware. Are you saying that it's not possible to connect the ADO service to EMS? It does mention that scenario in the documentation so I would like to try to get it working that way.

Honestly, I've never tried it that way. How have you set this up? Do you have the ADO pointing to a device that has the EMS, and that forwards the connection to the platform?

In my current setup the ADO, EMS and ThingWorx are all on the same PC. But I also tried with EMS on a gateway device (how I want to set it up eventually) and got the same 403 error. EMS is connected to ThingWorx ok, and ADO connects directly to ThingWorx ok. I'm just looking for someone to tell me if ADO and EMS are incompatible, or they should work and I've probably just configured incorrectly.

I don't think they are setup to work that way. The ADO functions like an EMS to create a connection and talk through the same connection. Having both the EMS and ADO running and connecting amongst each other might end up being redundant (as the EMS would be expecting properties or services if you're using lua, and the way ADO sends data in might be very different).

One thing you can look into is using a JDBC connector/ connection as well. Here's a Marketplace link to the same. You can simply import this extension, and create your own extension with a third party JDBC driver and connect to your DB directly from ThingWorx itself.

Thanks for the heads up. The thing that's confusing me is the ADO Service document which says on page 9 "As an example, if you plan to connect an SQL Server to the ThingWorx Platform through a firewall using the ThingWorx WebSocket-based Edge MicroServer and the ThingWorx Edge .NET SDK, you would install the ThingWorx ADO Service on the same client as the SQL Server". That's exactly what I want to do ("firewall" is the key word), but from what you're saying I can't. Are you able to update the documentation if that's not possible so others don't spend time trying to make it work that way?

That makes total sense, I can talk to the documentation team on rewording the content there. I believe the end message there was to note something on the lines of instead of using a combination of these two, you can simply use the ADO client to connect to the server directly.

Thanks, in that case they might want to reword the last sentence to something like "... you would instead install... on the same client as the SQL Server and connect directly to the Thingworx Platform", although that still doesn't address the firewall issue. It would be great to make the EMS compatible with ADO in a pass-through way, to help with situations where the SQL Server PC is firewalled. I don't think I'll be able to use the ADO Service because of the firewall.

On a related note, can I assume that the OPC service will likewise be incompatible with the EMS and not able to be used on a firewalled PC?

It would be the same. Quick question - would it not be possible for you to white list the ip where the db is running, or allow connections through port 443/ 8443 so that the ADO/ OPC can connect?

Top Tags