phonegap / phonegap-cli

PhoneGap and PhoneGap/Build command-line interface
Apache License 2.0
492 stars 157 forks source link

I am getting CORS issue while calling restful webservice from phone-gap index.html through ripple Emulator #555

Closed sebinjkannothu closed 7 years ago

sebinjkannothu commented 8 years ago

I am getting CORS issue while calling from Emulator, its working perfectly when Emulator is disabled. Tried a lot to achieve this. But nothing helped. It would be really great if someone could help.

Error I received " XMLHttpRequest cannot load https://rippleapi.herokuapp.com/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_…3A//192.168.0.4%3A8090/restfulwebservice/backend/user/service/getdtls/B001. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access. The response had HTTP status code 503."

mwbrooks commented 8 years ago

Hey @sebinjkannothu,

What version of the PhoneGap CLI are you using? You can check the version with phonegap -v. If possible, can you upgrade to phonegap@5.3.6.

Thanks! Michael

sebinjkannothu commented 8 years ago

Thank you so much for the information Michael. I have checked it and found the version as 4.2.0. I will upgrade it to 5.3.6. I am using aptana studio for a cross platform app. I am a beginner in PhoneGap. Can you advise me popular way (or tutorials) to make a cross platform PhoneGap app from where I can call a restful webservice.

hollyschinsky commented 8 years ago

Hi @sebinjkannothu,

Check out these links for some help with settings you can use to fix this with the Ripple emulator:

Let us know if it helps you get past the issue.

Cheers, Holly

happyaaz commented 7 years ago

I can confirm that changing my domain policy to disabled in Ripple solved the problem.

filmaj commented 7 years ago

Closing this issue. If it is still happening, please feel free to re-open and we can try to reproduce once more.