cancel
Showing results for 
Search instead for 
Did you mean: 

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxx.xxx:8000' is therefore not allowed access

Former Member
0 Kudos

Hi,

I'm trying write a XS application.

when using sapui5, I've included scripts below:

<script id="sap-ui-bootstrap" type="text/javascript"   

   src="http://abc.com:8001/sap/ui5/1/resources/sap-ui-core.js 

    data-sap-ui-language="en"

    data-sap-ui-libs="sap.ui.commons,sap.ui.ux3,sap.ui.table,sap.ui.richtexteditor"

    data-sap-ui-theme="sap_goldreflection"

    >

If the src is "https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js" => The app worked OK.

But when I'm try to change src to another server (2nd local XS server) ex:  src="http://abc.com:8001/sap/ui5/1/resources/sap-ui-core.js

The below error is happened:

XMLHttpRequest cannot load http://abc.com:8001/sap/ui5/1/resources/sap/ui/table/library-preload.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxx.xxx:8000' is therefore not allowed access

So, I guess, I must config in the 2nd XSserver to accept request from 1st server but I don't know how can I config it. Could you please help?

Thanks and best regards,

Binh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I've solved my issue by enable CORS in XS admin.

Best regards,

Binh

sivaganesh_krishnan
Contributor
0 Kudos

How exactly did you achieve it ??

Former Member
0 Kudos

Hi,

I'm going to : http://xxx.xxx.xxx.xx:8000/sap/hana/xs/admin/#/package/sap

and select CORS tab. In the end of page, you will see a EDIT button which you can enable "Enable Cross Origin Resource Sharing" function.

Best regards,

Binh