Skip to Content
avatar image
Former Member

Calling http service not working

I am trying to connect to outbound service and I get this error:

{"ERROR":"HttpClient.request: request failed. The following error occured: unable to establish connection to - internal error code: connection failed"}

I tried several variants but it does not work.

Service url:,uk&appid=bd82977b86bf27fb59a04b61b657fb6f

.xshttpdest file:

host = "";

port = 80;

description = "Weather";

useSSL = false;

pathPrefix = "data/2.5";

authType = none;

useProxy = false;

proxyHost = "";

proxyPort = 0;

timeout = 0;

.xsjs file:

    var destination;

    var client;

    var request;

    //Read the input employee number which is to be read



        //Reading the destination properties

        destination = $.net.http.readDestination("","gate");


          //Creating HTTP Client

          client = new $.net.http.Client();


          //Creating Request

          request = new $.web.WebRequest($.net.http.GET,"weather?q=London,uk&appid=bd82977b86bf27fb59a04b61b657fb6f");



          //Getting the response body and setting as output data





      ERROR : errorObj.message



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 26, 2015 at 01:04 PM

    Hello Matej,

    you have to adjust following points in your files.


    • host = ""; -> "http://" removed
    • pathPrefix = "/data/2.5" -> "/" added at the beginning
    • Proxy settings (due to your package name with your s-user trial ID I assume you are on the HCP HANA trial instance, for that use following values):
      • useProxy = true;
      • proxyHost = "proxy-trial";
      • proxyPort = 8080;


    • Add a "/" at the beginning of the path you are transferring to the constructor of the WebRequest -> new $.web.WebRequest($.net.http.GET,"/weather?q=London,uk&appid=bd82977b86bf27fb59a04b61b657fb6f")
    • Instead of $.web.WebRequest you should also use $.net.http.Request.

    Best Regards,


    Add comment
    10|10000 characters needed characters exceeded