cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to hit on premise services from Hana XSJS service

0 Kudos
181

I am trying to hit an On-Premise OData service from Hana XSJS service. In the response, I get the following error.

Access denied to system ecc.virtual.address:5000. In case this was a valid request, ensure to expose the system correctly in your cloud connector.


My xs destination file is:

host = "ecc.virtual.address";

port = 5000;

pathPrefix = "/sap/opu/odata/sap/ZMUR_HSE_SRV";

proxyType = http;

proxyHost = "localhost";

proxyPort = 20003;

authType = basic;

useSSL = false;

timeout = 3000;


My xsjs file is:

var destination_package = "HSE.Report_Incident.XSJS";

var destination_name = "premise";

try

{

var dest = $.net.http.readDestination(destination_package, destination_name);

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

var req = $.net.http.Request($.net.http.GET, "/IncidentGroupLookUpSet"); 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);

$.response.status = e.status;

}

View Entire Topic
HakanHaslaman
Product and Topic Expert
Product and Topic Expert
0 Kudos

Please check this blog which could be helpful in your case.