Skip to Content

Unable to connect to an internet service from SAP Cloud Platform using XSHTTPDEST

Sep 27, 2017 at 09:34 AM


avatar image
Former Member

Hello experts,

I am following the below tutorial on a productive SAP Cloud Platform Account.

I have created the http destination file and the XSJS service file in the same folder.

My destination file:

host = "";
port = 80; 
pathPrefix = "/maps/api/distancematrix/json"; 
authType = none; 
useSSL = false; 
timeout = 30000;

My XSJS service :

var destination_package = "GEOSPATIAL.connectivity";
var destination_name = "google";

try {
       var dest = $.net.http.readDestination(destination_package, destination_name);
       var client = new $.net.http.Client();
       var req = new $.web.WebRequest($.net.http.GET, "?origins=Frankfurt&destinations=Cologne&mode=driving⟨uage=en-US&sensor=false"); 
       client.request(req, dest);
       var response = client.getResponse();  
    $.response.contentType = "application/json";
       $.response.status = $.net.http.OK;
} catch (e) {
       $.response.contentType = "text/plain";

When accessing the application, I get the below error :

HttpClient.request: request failed: unable to establish connection to - IPcon: connection to host failed!

Any advise / suggestions will be appreciated!!!

Note : I could not find the role model_access that is mentioned in Step 4.

We are on HANA SPS 11.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Sep 27, 2017 at 10:28 AM

I was able to fix it by adding the below details to the destination.

proxyType = http; proxyHost = "proxy"; proxyPort = 8080;

10 |10000 characters needed characters left characters exceeded