Skip to Content
author's profile photo Former Member
Former Member

Issues with Access-Control-Allow-Origin Header even after Disabling Web Security in Chrome

I have been working on the Getting Started Documents on SAPUI5 Developer Guide section and I must confess its been very helpful.

But I am stuck at the point where the demo app is meant to pull in data from an OData service as in the below code excerpt in my Component.js file

metadata : {

..........

config : {

resourceBundle : "i18n/messageBundle.properties",

serviceConfig : {

name : "Northwind",

serviceUrl : "http://services.odata.org/V2/(S(sapuidemotdg))/OData/OData.svc/"

}

..........

}

The below error code are shown in my Google Chrome console even after disabling web security;

OPTIONS http://services.odata.org/V2/(S(sapuidemotdg))/OData/OData.svc/$metadata 501 (Not Implemented)

XMLHttpRequest cannot loadhttp://services.odata.org/V2/(S(sapuidemotdg))/OData/OData.svc/$metadata. No 'Issu' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 501.

OPTIONS http://services.odata.org/V2/(S(sapuidemotdg))/OData/OData.svc/$metadata 501 (Not Implemented)

XMLHttpRequest cannot loadhttp://services.odata.org/V2/(S(sapuidemotdg))/OData/OData.svc/$metadata. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 501.

Please how do I resolve this as there no suitable answers from the forum

Regards

wale Adeoye

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 26, 2015 at 02:27 PM

    Well, the message "No 'Access-Control-Allow-Origin' header is present on the requested resource" clearly indicates you have not disabled web security on your browser...

    Which browser are you using, and how exactly did you try to allow CORS?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Disable web security should be enough, I've created shortcut with the following. However as Robin mentioned you need to make sure all chrome processes are closed.

      C:\Users\xxxxxx\AppData\Local\Google\Chrome\Application\chrome.exe --disable-web-security

      Regards,

      Jason

  • author's profile photo Former Member
    Former Member
    Posted on Jan 26, 2015 at 03:55 PM

    So I got this sorted, thanks to @Robin van het Hof and @Jason Moors

    In case, anybody has this same issues, Just follow the below procedure I used to solve mine on a Windows 7 PC

    1. Make sure you close out all instances of Google Chrome including ending all its processes in the Windows Task Manager

    2. Right-Click on your Google Chrome Icon, Copy the text in the Target: field without quotes - (in my case - C:\Program Files (x86)\Google\Chrome\Application\chrome.exe)

    3 Open command prompt and paste the copied text and add --disable-web-security (in my case - cd C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --disable-web-security)

    You should then be up and running. Once Chrome starts, You will get a yellow bar at the top of the page indicating "You are using an unsupported command-line flag"

    Hope this helps another newbie that maybe coming long.

    Thanks all

    Regards

    Adewale Adeoye

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2016 at 03:27 AM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.