Error retrieving json map service info when upgrading to 10.2 SDK

3521
4
12-03-2013 07:36 AM
Labels (1)
DanielRouleau
New Contributor III
We are seeing some differences in the requests and responses that come back from our application when upgrading from the 10.1.1 WPF SDK to the 10.2 WPF SDK. Both instances are hitting a public facing ArcGIS Server running at 10.1. Nothing else changed in the environment between the 2 applications, does anyone have any recommendations as to where to look to figure out the source of this problem? Looking at the requests in Fiddler, it looks like the new If-Range in the http header may be contributing to the problem.

10.1.1 Request

GET http://server.arcfmsolution.com/arcgis/rest/services/ElectricDistribution/MapServer?f=json HTTP/1.1
Host: server.arcfmsolution.com
Accept-Encoding: gzip, deflate

10.1.1 Response

{"currentVersion":10.1,"serviceDescription":"Schneiderville - SQL Server 2012","mapName":"Layers","description":"","copyrightText":"","supportsDynamicLayers":false,"layers":[{"id":0,"name":"Surface Structure","parentLayerId":-1,"defaultVisibility":true,"subLayerIds":null,"minScale":2400,"maxScale":700}...

10.2 Request

GET http://server.arcfmsolution.com/arcgis/rest/services/ElectricDistribution/MapServer?f=json HTTP/1.1
Host: server.arcfmsolution.com
If-Range: 910936a2
Range: bytes=6028-
Accept-Encoding: gzip, deflate

10.2 Response

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 02 Dec 2013 22:40:27 GMT
Content-Length: 1410

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>
Application Error
</title></head>
<body>
    <p>
        <img src="/arcgis/webadaptor/header.jpeg" id="headerIMG" alt="ArcGIS Web Adaptor" longdesc="ArcGIS Web Adaptor Configuration" />
    </p>
    <p id="helpLinkElement" class="center" align="right">
        <a id="helpLink" href="../../../WebAdaptorHelp/Index.html" target="_blank">Help</a>
    </p>
        <p class="errorTitle">
            Application Error
        </p>
        <p class="errorLabel">
            This header must be modified using the appropriate property.
Parameter name: name
        </p>
</body>
</html>
0 Kudos
4 Replies
MichaelConly
New Contributor
More info - Here's the error log from the same machine throwing the error


[INDENT]Log Entry : 12/4/2013 3:05:55 PM
  Request failed
  http://server.arcfmsolution.com/arcgis/rest/services/GasDistribution/MapServer?f=json
  :This header must be modified using the appropriate property.
Parameter name: name
  :   at System.Net.WebHeaderCollection.ThrowOnRestrictedHeader(String headerName)
   at System.Net.WebHeaderCollection.Set(String name, String value)
   at ESRI.ArcGIS.WebAdaptor.AGSHandler.TransferRequestHeaders(HttpWebRequest req, HttpRequest srcRequest)
   at ESRI.ArcGIS.WebAdaptor.AGSHandler.SendRedirectRequest(HttpRequest srcRequest, String url, Boolean rewriteUrlsInResponse)
   at ESRI.ArcGIS.WebAdaptor.AGSHandler.TransferRequest(HttpContext context)
   at ESRI.ArcGIS.WebAdaptor.AGSHandler.ProcessRequest(HttpContext context)[/INDENT]


My pet theory is that the 10.1 web adapter barfs when it tries to copy the headers from the 10.2 SDK request to forward it to <server>:<port>. IF and RANGE headers are restricted in webRequest.Headers.Add...
0 Kudos
DominiqueBroux
Esri Frequent Contributor
The issue is coming from a bug in ArcGIS WebAdaptor which doens't transfert correctly the range headers ending by '-'.
The issue has been fixed in the version 10.2.1 of WebAdaptor.

Out of the upgrade to 10.2.1, the workaround may be to disable the cache at client side with init code like:
ArcGISWebClient.DefaultCachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);

But this will decrease the performances so consider it as a temporarly workaround.
0 Kudos
MichaelConly
New Contributor
Thanks Dominique. That does seem to work around the problem.

Do you know if there will be a patch for Web Adapter 10.1? We need to be able to hit 10.1 server from 10.2 WPF SDK without affecting performance.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Thanks Dominique. That does seem to work around the problem.

Do you know if there will be a patch for Web Adapter 10.1? We need to be able to hit 10.1 server from 10.2 WPF SDK without affecting performance.

Sorry I have little info about the versions that fix the issue.
I suggest you to post your question on Portal Forum or to ask the support.
0 Kudos