Skip to Content
0

CORS error from SAPUI5 when accessing the XSODATA

Oct 31, 2016 at 01:06 PM

342

avatar image
Former Member

I am trying accessing XSODATA to get DB data from SAPUI5 Application.

Then, CORS error from SAPUI5 when access the XSODATA.

Please tell me about description of the JAVA Application, JS File and .xsaccess file which to escape error.

【ERROR MESSAGE】

The XMLHttpRequest is required CORS Preflight Preflight.

Original http: // localhost: 8080 can not be found in the Access-Control-Allow-Origin header.

XMLHttpRequest: network error 0x80070005, access is denied.

【Source】

var oModel = new sap.ui.model.odata.ODataModel("https://XXXtrial.hanatrial.ondemand.com/XXX/XXX.xsodata",true);

var oBaseModel = new sap.ui.model.json.JSONModel(); oModel.read("/XXX", null, null, false, function(oData) { oBaseModel.setData(oData.results); });

var oBaseData = oBaseModel.getData();

console.log(oBaseData);

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Masayuki Sekihara
Nov 01, 2016 at 04:56 AM
0

Please elaborate the testing landscape. We do not get why localhost is there.

Is it SAPUI5 app or Java app?

Have you deployed the app on HCP?

Regards,

Masa / SAP Technology RIG

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 07, 2016 at 01:53 AM
0

>Is it SAPUI5 app or Java app?

It is Java app.

bat I will use SAPUI5 app too.

>Have you deployed the app on HCP?

Yes.

I deployed JAVA application on trialHCP

Even if I set like 「Original」, it will be the same problem.

https: //%applicationName%%AccountName%trial.hanatrial.ondemand.com

Share
10 |10000 characters needed characters left characters exceeded
Masayuki Sekihara
Nov 07, 2016 at 03:33 AM
0
Share
10 |10000 characters needed characters left characters exceeded