Skip to Content
0

GW ODATA on SAP HANA XS in SAPUI5

Aug 29, 2017 at 10:32 AM

51

avatar image

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);
			});
capture.png (21.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Aug 29, 2017 at 12:35 PM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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,

0
avatar image
Former Member Aug 29, 2017 at 03:33 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Anurag,

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

Regards,

0