Select to view content in your preferred language

Access Is Denied

3853
1
Jump to solution
10-01-2014 02:45 PM
AlexeiB
Deactivated User

Hello,

I am trying to execute a query from a custom widget that I wrote.

Code:

var qt = new QueryTask('http://[url]/MapServer/0');

var q = new Query();

q.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;

q.outSpatialReference = { wkid: 102100 };

q.returnGeometry = true;

q.outFields = ["*"];

q.geometry = this.geometry; // I know this is a polygon

qt.execute(q, function(resultList) { /* do stuff here */ }, function(err){ /* catch error */});

If I run this code from a widget using IE 9, I get an Access Is Denied error in /* catch error */. If I run this code from outside the widget in IE9 it seems to work fine. If I run this code from IE 11 or Firefox, it works regardless of whether or not it is in a dijit widget.

My proxies are in place and everything seems to be ok on that side.

Has anyone experienced this behavior before? Any tips are appreciated.

Thanks.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AlexeiB
Deactivated User

It appears I have solved it! The issue was the proxy. I had established a proxy on my live site which I was using from my development machine. This works well if I access the site from the live URL. But if I used the proxy from my local machine using IE9 I was getting that error. I resolved the problem by copying the proxy to my local IIS on my machine and set a relative proxy URL vs the absolute I had before in my code.

View solution in original post

0 Kudos
1 Reply
AlexeiB
Deactivated User

It appears I have solved it! The issue was the proxy. I had established a proxy on my live site which I was using from my development machine. This works well if I access the site from the live URL. But if I used the proxy from my local machine using IE9 I was getting that error. I resolved the problem by copying the proxy to my local IIS on my machine and set a relative proxy URL vs the absolute I had before in my code.

0 Kudos