1 Reply Latest reply on Sep 7, 2017 5:49 AM by jamesm RSS
    pmishra-4 Explorer

    Error while calling REST service

    Hi,

     

    I am getting error while calling thing service . While its working fine for locally deployed service . I am getting below error

    Wrapped java.net.UnknownHostException: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (dev1.tcupiot.com) Cause: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (dev1.tcupiot.com)

     

    The service i am trying is :-

     

     

    var params1 = {

    proxyScheme: undefined /* STRING */,

    headers:{

      "Accept": "*/*",

      "tenantId": "12345"

    },

    ignoreSSLErrors: true /* BOOLEAN */,

    useNTLM: undefined /* BOOLEAN */,

    workstation: undefined /* STRING */,

    useProxy: undefined /* BOOLEAN */,

    withCookies: undefined /* BOOLEAN */,

        url:"http://xxxx.com/app/user5/XXXservice/Alert/Query?eventDateTime=YYYY-MM-dd" /* STRING */,

        //url:"http://localhost:8081/XXXXservice/Alert/Query?eventDateTime=2016-06-12%2C2018-10-15",

        timeout: undefined /* NUMBER */,

    proxyPort: undefined /* INTEGER */,

    password: undefined /* STRING */, 

    username: undefined /* STRING */

    };

     

     

    // result: JSON

    var data = Resources["ContentLoaderFunctions"].GetJSON(params1);

     

     

    var params2 = {

    infoTableName: "alertTable" /* STRING */,

    dataShapeName: "AlertDataShape" /* DATASHAPENAME */

    };

    var jsonTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params2);

    for(var i=0;i<data.array.length;i++)

    {

     

    jsonTable.AddRow({vehicleRegNo:data.array[i].vehicleRegNo,

                      eventTypeName:data.array[i].eventTypeName,

                      eventLocDescription:data.array[i].eventLocDescription,

                     eventDatetime:data.array[i].eventDatetime,

                      speed:data.array[i].speed,

                      description:data.array[i].description

                     });

     

    }

    result = jsonTable;