on 04-08-2014 3:34 AM
Dear All,
i am trying the sencha odata connector to consuming the flight service(http://sapes1.sapdevcenter.com:8080/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/).
but with the error "Origin http://localhost is not allowed by Access-Control-Allow-Origin.", i still cannot get the data from the flight.
and i already set the properties in the proxy.
withCredentials: true, |
useDefaultXhrHeader : false, |
here is the odata connector links Sencha Touch OData Connector for SAP Sencha Connector: Data — Sencha Market(and the sample code is in the zip)
anybody could help me on this?
thank you very much
best regards
lawrence
You could also while developing the app locally on your laptop pass the below option to Chrome. Note you will need to close all running instances of Chrome before this setting takes effect. There will be a message shown when Chrome opens indicating that the setting is in effect.
--disable-web-security
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The reason you are getting "Origin http://localhost is not allowed by Access-Control-Allow-Origin." is because you are trying to make a cross-origin call. Your Sencha Touch code is on http://localhost and you are trying to get data from a different domain, in your case it is:
http://sapes1.sapdevcenter.com/
The same-origin policy enforces that browsers only allow Ajax calls to services in the same domain as the HTML page.
There are two easy ways to make a cross-origin call:
References:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.