Skip to main content
1-Visitor
May 4, 2018
Question

Web Service problems

  • May 4, 2018
  • 1 reply
  • 875 views

 

Spoiler
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);

 

1 reply

5-Regular Member
May 16, 2018

Hi @Assaito could you share full error stack from the script log. I'm not sure but it could be formatting issue around the JSON that you are attempting to pass, esp. around "+token" . Does it continue to fail even if you have blank space between "+" & "token" ?