Use Proxy with large definition expression, js api sending GET and not using proxy...

674
0
11-08-2013 04:54 AM
DerrickMartin
New Contributor II
I'm trying to set a definition expression for a FeatureLayer, and from looking at the generated request, the size is over the 2048 character limit. Ok, no problem, setup a proxy. However, when I do setup the proxy, the request is still going directly to the map service and not going through the proxy page. In an attempt to see what is going on, I set the alwaysUseProxy to true to force it. Now, it is calling the proxy, but it's calling it via a GET request instead of a POST which causes IIS to return a 403 error with the following message "Due to the presence of characters known to be used in Cross Site Scripting attacks, access is forbidden.  This web site does not allow Urls which might include embedded HTML tags"
I'm guessing that if it was a POST it might work, but I can't seem to figure out why it's using GET instead, or why when I don't have the alwaysUseProxy set that it doesn't try to use the proxy when it should due to the large size of the query string. Any ideas?

Heres the section of my code where I set the proxy page:

require(['esri/config','esri/map','esri/dijit/BasemapGallery', 'esri/dijit/Basemap', 'esri/dijit/BasemapLayer','esri/layers/ArcGISTiledMapServiceLayer','esri/layers/FeatureLayer','esri/tasks/query','esri/tasks/QueryTask','esri/symbols/SimpleFillSymbol','esri/symbols/SimpleLineSymbol','esri/renderers/SimpleRenderer','esri/graphic','esri/lang','esri/graphicsUtils','dojo/_base/Color','dojo/number','dojo/dom-style','dijit/TooltipDialog','dijit/popup', 'dojo/parser', 'dojo/query','dijit/layout/BorderContainer','dijit/layout/ContentPane','dijit/TitlePane','dojo/domReady!'], function(esriConfig,Map,BasemapGallery, Basemap, BasemapLayer,ArcGISTiledMapServiceLayer,FeatureLayer,Query,QueryTask,SimpleFillSymbol,SimpleLineSymbol,SimpleRenderer,Graphic,esriLang,graphicsUtils,Color,number,domStyle,TooltipDialog,dijitPopup,parser,dojoQuery) {
  parser.parse();


  esriConfig.defaults.io.proxyUrl = 'proxy.ashx';


Here is the request that is generated:

http://arcgisserver/ArcGIS/rest/services/Boundaries/MapServer/5/query?f=json&where=CLLI%20IN%20(%27A...

As you can see, it's sending the request directly as a GET to the arcgisserver instead of POST to the proxy page.
0 Kudos
0 Replies