12 Replies Latest reply on Aug 4, 2016 10:06 AM by aanjan RSS
    gmcnamara Explorer

    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

      • Re: 403 error trying to connect ADO Service via EMS
        aanjan Heavyweight Champ

        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.

        • Re: 403 error trying to connect ADO Service via EMS
          gmcnamara Explorer

          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

            • Re: 403 error trying to connect ADO Service via EMS
              aanjan Heavyweight Champ

              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.

                • Re: 403 error trying to connect ADO Service via EMS
                  gmcnamara Explorer

                  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.

                    • Re: 403 error trying to connect ADO Service via EMS
                      aanjan Heavyweight Champ

                      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?

                        • Re: 403 error trying to connect ADO Service via EMS
                          gmcnamara Explorer

                          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.

                            • Re: 403 error trying to connect ADO Service via EMS
                              aanjan Heavyweight Champ

                              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.

                                • Re: 403 error trying to connect ADO Service via EMS
                                  gmcnamara Explorer

                                  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?