cancel
Showing results for 
Search instead for 
Did you mean: 

GW ODATA on SAP HANA XS in SAPUI5

former_member383720
Participant
0 Kudos

Hello,

I am designing a SAPUI5 Application on SAP HANA XS in which I want to use a ODATA service from separate Gateway Server (using http). I tried by passing credentials also in OData Model but still call is unsuccessful.

I am testing this in Google Chrome and no pop-up comes to enter Credentials.

var url ="http://hostname:50000/sap/opu/odata/sap/ZDEMO_ODATA_SRV/";

var oModel = new sap.ui.model.odata.ODataModel(url,false,"Username" ,"Passsowrd");

//Also tried :
//var oModel = new sap.ui.model.odata.ODataModel(url,false,{user:"Username"
// ,password:"Passsowrd"});

		    var	path = "/REG_SalesSet";
			var that = this;
			
oModel.read(path, null, function(oData, oResponse){
	var model = new sap.ui.model.json.JSONModel(oData.results);
		this.setModel(model);
			});

Accepted Solutions (0)

Answers (2)

Answers (2)

junwu
Active Contributor

normally if your app is hosted in serverA, you can only call odata service from serverA. if you want to call odata from serverB, you need proxy to do the job for you.

google SOP, CORS

former_member383720
Participant
0 Kudos

Hi Jun,

I have already tried all possible solutions for CORS -

1. proxy/http/hostname:port/sap/opu/odata/sap/ZDEMO_ODATA_SRV/

2. Enabled CORS extension in Google Chrome

3. tested in Goggle Chrome by launching it using --disable-web-security

But nothing worked.

Regards,

former_member224398
Participant
0 Kudos

you can install a chrome plugin name as "CORS" and turn the setting ENABLE. It will work.

former_member383720
Participant
0 Kudos

Hi Anurag,

Already Enabled "CORS"" but it didn't solved my issue.

Regards,