host = "ecc.virtual.address"; // Virtual Host defined on Cloud Connector
port = 5000; // Virtual Port defined on Cloud connector
pathPrefix = "/sap/opu/odata/sap/EHS_INC_REPORTINCIDENT_SRV/"; // OData Service
useProxy = true; // Its should be true , as we re using On-Premise system
proxyHost = "localhost"; //connects, via a Cloud Connector tunnel,
//to on-premise services and resources
proxyPort = 20003; // Proxy Port
authType = basic; // Authentication Type is Basic Authentication
useSSL = false;
timeout = 30000;
var destination_package = "Test_XSJS.OdataFromXSJS"; //
var destination_name = "gateway"; //e.g. demo
var dest = $.net.http.readDestination(destination_package, destination_name);
var client = new $.net.http.Client();
var response = client.getResponse();
try {
var req = new $.web.WebRequest($.net.http.GET, "Locations?$format=json");//Entity Set
req.headers.set("SAP-Connectivity-SCC-Location_ID", "Bangalore");
// This is mandatory .Else the Call from XSJS fails to find the exact
//cloud Cloud Connector Instance which is mapped to the Backend ECC System
req.headers.set("X-CSRF-Token", "CSRF");
client.request(req, dest);
$.response.setBody(response.body.asString());
$.response.contentType = "application/json";
$.response.status = $.net.http.OK;
}
catch (e)
{
$.response.contentType = "text/plain";
$.response.setBody(e.message);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |