Skip to Content
avatar image
Former Member

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

Hello experts,

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

https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/06ca24043b0f4eb78cf39c6bc1d8a8dc.html

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

My destination file:

host = "maps.googleapis.com";
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.setBody(response.body.asString());
       $.response.status = $.net.http.OK;
} catch (e) {
       $.response.contentType = "text/plain";
       $.response.setBody(e.message);
}


When accessing the application, I get the below error :

HttpClient.request: request failed: unable to establish connection to maps.googleapis.com:80 - 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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

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;

    Add comment
    10|10000 characters needed characters exceeded