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

WebService Problem

Regular Member

WebService Problem

Hi All,


I created a service using the snippet function GetText and received this mesage error: "Name or service not known - See Script Error Log for more details."


See the code below for details


var token = "eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJlNDIzNjI2NS1kMjBlLTQwYmMtODExMC1mYWVlYWFlZjE4ZjUiLCJzdWIiOiJhZG1pbiIsImF1dGhvcml0aWVzIjpbImNsaWVudHMucmVhZCIsImhpc3Rvcmlhbl9yZXN0X2FwaS5yZWFkIiwicGFzc3dvcmQud3JpdGUiLCJjbGllbnRzLnNlY3JldCIsImhpc3Rvcmlhbl9yZXN0X2FwaS5hZG1pbiIsImhpc3Rvcmlhbl9yZXN0X2FwaS53cml0ZSIsImNsaWVudC5hZG1pbiIsImNsaWVudHMud3JpdGUiLCJ1YWEuYWRtaW4iLCJzY2ltLndyaXRlIiwic2NpbS5yZWFkIl0sInNjb3BlIjpbImNsaWVudHMucmVhZCIsImhpc3Rvcmlhbl9yZXN0X2FwaS5yZWFkIiwicGFzc3dvcmQud3JpdGUiLCJjbGllbnRzLnNlY3JldCIsImhpc3Rvcmlhbl9yZXN0X2FwaS5hZG1pbiIsImhpc3Rvcmlhbl9yZXN0X2FwaS53cml0ZSIsImNsaWVudC5hZG1pbiIsImNsaWVudHMud3JpdGUiLCJ1YWEuYWRtaW4iLCJzY2ltLndyaXRlIiwic2NpbS5yZWFkIl0sImNsaWVudF9pZCI6ImFkbWluIiwiY2lkIjoiYWRtaW4iLCJhenAiOiJhZG1pbiIsImdyYW50X3R5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJyZXZfc2lnIjoiZjQyOTM5NTMiLCJpYXQiOjE1MjU0NjY2MjEsImV4cCI6MTUyNTUwOTgyMSwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL3VhYS9vYXV0aC90b2tlbiIsInppZCI6InVhYSIsImF1ZCI6WyJhZG1pbiIsImNsaWVudHMiLCJoaXN0b3JpYW5fcmVzdF9hcGkiLCJwYXNzd29yZCIsImNsaWVudCIsInVhYSIsInNjaW0iXX0.jLLQewesfiI9mIc3IGbvIr4xG1wSxg9TDkcmOEPBRGwsDIvowRApDKE2zat_N4cVkPwwK4XuZChAkL8M0KB6KJBO6sG4OvPVH7kSAovXasKZob2eMgfXSuofrQhzHLUB-GkjN2dkbuPE47pl8azHeVVQz0B5Q5BrYEvVNf-ZIDoJOnGQbgnsQDjrvQoOVWtm9hJvLkByHYviRq-YCDd4QFqIfZdviXxQ0sQ0lBlifZDiEqhreVfl9nxsdW0SsN8rdPTuDpS1BUx4sFjEmAC5BoaS9ypjXLkWNw_zb8QVfCrh94EwDrAZf1Hn4ktRX1-mbcgliFDjo6mdsJJosrs0Fw";


var params = {

proxyScheme: undefined /* STRING */,

headers: {"Accept":"application/json","Authorization":"Bearer "+token}/* JSON */,

ignoreSSLErrors: undefined /* BOOLEAN */,

useNTLM: undefined /* BOOLEAN */,

workstation: undefined /* STRING */,

useProxy: undefined /* BOOLEAN */,

withCookies: undefined /* BOOLEAN */,

url: "http://mymachine:8080/historian-rest-api/v1/datapoints/currentvalue/mymachine.Simulation00001" /* STRING */,

timeout: undefined /* NUMBER */,

proxyPort: undefined /* INTEGER */,

password: undefined /* STRING */,

domain: undefined /* STRING */,

username: undefined /* STRING */ };


var result = Resources["ContentLoaderFunctions"].GetText(params);


Re: WebService Problem

Name or Service unknown seems to imply the end point isn't correct, should the url be case sensitive?

Re: WebService Problem

I dont think that's the case...(see the image attached)

Just some details to share, I'm using a VM as a server for my webservice and trying to acess it from my local machine trough thingworx server.


Any clues?


Re: WebService Problem

You could have a typo in your service

You could be having firewall problems on the webservice VM. Turn off your firewall temporarily and see if the request works when the firewall is off. If so, add the necessary holes into your firewall to allow the traffic.

The webservice might not be running. Verify you see the process running

The webservice request might be wrong in some way. Use Postman to verify the webservice operation.


 Also, you can check your webservice logs to see if you actually got any requests from Thingworx. For instance, if your webservice is using Tomcat, check the latest *access* log file to see if you're seeing the requests from Thingworx even arrive.




Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.