Skip to Content
0
Nov 27, 2017 at 06:53 AM

Failed to load https:/************.xsjs/collection:

89 Views

Hi Folks,

I tried to read the data from oData service URL. Below is controller code and the error in the console.

Failed to load https:/************.xsjs/collection: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://webidetesting3041367-p1942892270trial.dispatcher.hanatrial.ondemand.com' is therefore not allowed access.

var serviceURI = "https://**************.xsjs/";


var username = "*********";


var password = "**********";


var OData = new sap.ui.model.odata.ODataModel(serviceURI,true ,username,password);
OData.read("/Collection", {
   success: function(oData) {
     alert(JSON.stringify(oData));
   }
});

Please check the code and error and tell me the resolution.

Regards,
Aravind
<br>