cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Any Sample of accessing OData services of ES5 , without bypassing corporate internet security

0 Kudos

Any Sample code of accessing OData services of ES5 from client side html page, without bypassing corporate internet security

Is it possible to share sample code of accessing OData services of ES5 system,

using a single html page,

without bypassing corporate internet security.

Tried using urls
https://cors-anywhere.herokuapp.com/sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/ 

and

 https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/ 

But was getting errors in connection process.

Below is a sample code for accessing Northwind DB, using script.

Is it possible to provide a sample code for accessing OData services of ES5.

<script>
var sURL1 = "http://services.odata.org/V4/Northwind/Northwind.svc/Customers";
var oModel = new sap.ui.model.json.JSONModel(sURL1, true);
sap.ui.getCore().setModel(oModel);
var oTable = new sap.m.Table("tableID", {
columns : [ new sap.m.Column ({ 
header:[ new sap.m.Label ({text: "Customer ID"})]}),
new sap.m.Column ({ header :[ new sap.m.Label ({text: "Company Name"})]})
]
});
oTable.bindItems("/value", new sap.m.ColumnListItem("listItem",{
cells:[ new sap.m.Text({text: "{CustomerID}"}),
new sap.m.Text ({text: "{CompanyName}"})
]}));
oTable.placeAt("content");
</script>

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

normally you will deploy the code to the server where the service is hosted to run the app