Select to view content in your preferred language

Map export fails because of 2048 character URI length limit

1233
3
09-26-2011 04:26 PM
RyanCooney
Occasional Contributor
When the map control makes requests to the MapServer/export endpoint it uses 2083 characters as the maximum URI length before switching from GET to POST. The plugin/browser prevents requests at 2048 characters so sometimes you can't get a map image.

The behavior is pretty simple to replicate:

1. Start with the ESRI API sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DynamicMap.

2. Artificially inflate the list of visible layers by adding duplicate layer IDs. This will make your request really long. You'll probably need about 600 layer IDs. It's low tech but effective.
<esri:ArcGISDynamicMapServiceLayer ID="MyLayer"
                Url="http://maverick.arcgis.com/ArcGIS/rest/services/World_WGS84/MapServer"
                VisibleLayers="1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1....." />


3. Watch the requests in Fiddler and you'll see your GET request URLs approach 2048 characters, and then the map will go blank and you won't see any requests in Fiddler.

4. Keep adding layers and checking Fiddler.

5. Eventually the map image will appear and you'll see POST requests in Fiddler. Presumably we have now hit the 2083 character limit.

This is quite important for our customers that use WKT spatial references. They frequently hit this limit.

Thanks,

--Ryan
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
What version of the API are you using?
0 Kudos
TonyContreras
Deactivated User
This is probably caused by a limit on the IIS web server.
To increase the limit, follow the steps:
1. Run the Command prompt as Administrator.
2. At the Command Prompt, type cd %windir%\system32\inetsrv, and then press ENTER.
3. Enter the following command (adjust the number value as desired, the default is 2048): appcmd set config /section:requestfiltering /requestlimits.maxquerystring:4096
4. Restart IIS with the iisreset command.

Configure Request Filters in IIS 7
0 Kudos
JenniferNery
Esri Regular Contributor
Thank you for your feedback. I was able to reproduce this issue when request for image is not sent, therefore resulting to a blank map. We will try to get this fixed in future versions. Thanks.
0 Kudos