Hello everyone,
I am calling from javascript in a WebApp Application a rest web service using json,
var requestHandle = esriRequest({
"url": url,
"handleAs": "json",
}, {
useProxy: true,
usePost: false,
disableIdentityLookup: true
});
// requestHandle.then(this.requestSucceeded, this.requestFailed);
requestHandle.then(
lang.hitch(this, function (response, io) {
....
and I am getting the following error message:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
this code was working until I upgrade the asp.net application from framework .Net Framework 2 to .Net Framework 4
Thanks
Jose,
I almost never use localhost because of these type situations. Use your machine name and make sure your machine name is setup in your proxy.
Hi Robert,
I am using tau machine name, and the name of the proxy. this code ran in .Net framework 2.0 but after upgrading the project to .Net framework 4.0 I have 2 issues, the call to the rest web service does not work and visual store does not stop at the point on debug.
Thanks
Jose,
Hmm.. I can't really tell you what might be going wrong. I can tell you that I have several RESTful .net 4.0 web service that work fine for me so it is not just a .net 4.0 thing.
Do you have allowedReferers as * in your proxy.config?