Skip to Content
avatar image
Former Member

CORS error from SAPUI5 when accessing the XSODATA

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);

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Nov 01, 2016 at 04:56 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 07, 2016 at 01:53 AM

    >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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 07, 2016 at 03:33 AM
    Add comment
    10|10000 characters needed characters exceeded