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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Web Service problems

Assaito
7-Bedrock

Web Service problems

 

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 1
supandey
19-Tanzanite
(To:Assaito)

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" ?

Top Tags