<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic WMS problems with 10.1 and Proxy files in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/wms-problems-with-10-1-and-proxy-files/m-p/200221#M4940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone.&amp;nbsp; We finally upgraded to AGS 10.1 and are switching over our web services.&amp;nbsp; One issue I am running into is using the layers as WMS with a Proxy file (one of many error actually but I have gotten around the others).&amp;nbsp; Using SL 5 and version 3.1 of the API (also tried this with SL 4 and api 3.0 but upgraded to see if it made a difference).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Prior to 10.1, I had a bunch of different layer types load in our SL app - Dynamic, Tiled and WMS.&amp;nbsp; Also had a proxy file sitting on the same server in the the app (ie ./Proxy/proxy.ashx and proxy.config).&amp;nbsp; Everything worked fine, I added url stems to the proxy file with a match all set.&amp;nbsp; So for example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;serverItem url="http://serverx/" matchAll="true" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case the layer did not have security turned on but we have to add an entry for it anyway - which worked fine.&amp;nbsp; Now, with 10.1, I keep getting a "not found" error bounce back from the WMS layer.&amp;nbsp; I tried adjusting for the port with something like this but no dice:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;serverItem url="http://serverx:6080/" matchAll="true" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fidder comes back with this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;Non-negative number required.&lt;BR /&gt;Parameter name: count &lt;BR /&gt;Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &lt;BR /&gt;&lt;BR /&gt;Exception Details: System.ArgumentOutOfRangeException: Non-negative number required.&lt;BR /&gt;Parameter name: count&lt;BR /&gt;&lt;BR /&gt;Source Error: &lt;BR /&gt;&lt;BR /&gt;Line 108:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;Line 109:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BinaryReader br = new BinaryReader(byteStream);&lt;BR /&gt;Line 110:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] outb = br.ReadBytes((int)serverResponse.ContentLength);&lt;BR /&gt;Line 111:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; br.Close();&lt;BR /&gt;Line 112: &lt;BR /&gt;&lt;BR /&gt;Source File: c:\....\Proxy\proxy.ashx&amp;nbsp;&amp;nbsp;&amp;nbsp; Line: 110 &lt;BR /&gt;&lt;BR /&gt;Stack Trace: &lt;BR /&gt;[ArgumentOutOfRangeException: Non-negative number required.&lt;BR /&gt;Parameter name: count]&lt;BR /&gt;&amp;nbsp;&amp;nbsp; System.IO.BinaryReader.ReadBytes(Int32 count) +14387194&lt;BR /&gt;&amp;nbsp;&amp;nbsp; proxy.ProcessRequest(HttpContext context) in c:\....l\Proxy\proxy.ashx:110&lt;BR /&gt;&amp;nbsp;&amp;nbsp; System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +913&lt;BR /&gt;&amp;nbsp;&amp;nbsp; System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously) +165&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I disable the code that sets t he Proxy in the WMSLayer.ProxyUrl property everything works fine.&amp;nbsp;&amp;nbsp; Any insight?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ernie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jun 2013 13:03:19 GMT</pubDate>
    <dc:creator>ErnieSalazar</dc:creator>
    <dc:date>2013-06-07T13:03:19Z</dc:date>
    <item>
      <title>WMS problems with 10.1 and Proxy files</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/wms-problems-with-10-1-and-proxy-files/m-p/200221#M4940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone.&amp;nbsp; We finally upgraded to AGS 10.1 and are switching over our web services.&amp;nbsp; One issue I am running into is using the layers as WMS with a Proxy file (one of many error actually but I have gotten around the others).&amp;nbsp; Using SL 5 and version 3.1 of the API (also tried this with SL 4 and api 3.0 but upgraded to see if it made a difference).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Prior to 10.1, I had a bunch of different layer types load in our SL app - Dynamic, Tiled and WMS.&amp;nbsp; Also had a proxy file sitting on the same server in the the app (ie ./Proxy/proxy.ashx and proxy.config).&amp;nbsp; Everything worked fine, I added url stems to the proxy file with a match all set.&amp;nbsp; So for example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;serverItem url="http://serverx/" matchAll="true" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case the layer did not have security turned on but we have to add an entry for it anyway - which worked fine.&amp;nbsp; Now, with 10.1, I keep getting a "not found" error bounce back from the WMS layer.&amp;nbsp; I tried adjusting for the port with something like this but no dice:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;serverItem url="http://serverx:6080/" matchAll="true" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fidder comes back with this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;Non-negative number required.&lt;BR /&gt;Parameter name: count &lt;BR /&gt;Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &lt;BR /&gt;&lt;BR /&gt;Exception Details: System.ArgumentOutOfRangeException: Non-negative number required.&lt;BR /&gt;Parameter name: count&lt;BR /&gt;&lt;BR /&gt;Source Error: &lt;BR /&gt;&lt;BR /&gt;Line 108:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;Line 109:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BinaryReader br = new BinaryReader(byteStream);&lt;BR /&gt;Line 110:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] outb = br.ReadBytes((int)serverResponse.ContentLength);&lt;BR /&gt;Line 111:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; br.Close();&lt;BR /&gt;Line 112: &lt;BR /&gt;&lt;BR /&gt;Source File: c:\....\Proxy\proxy.ashx&amp;nbsp;&amp;nbsp;&amp;nbsp; Line: 110 &lt;BR /&gt;&lt;BR /&gt;Stack Trace: &lt;BR /&gt;[ArgumentOutOfRangeException: Non-negative number required.&lt;BR /&gt;Parameter name: count]&lt;BR /&gt;&amp;nbsp;&amp;nbsp; System.IO.BinaryReader.ReadBytes(Int32 count) +14387194&lt;BR /&gt;&amp;nbsp;&amp;nbsp; proxy.ProcessRequest(HttpContext context) in c:\....l\Proxy\proxy.ashx:110&lt;BR /&gt;&amp;nbsp;&amp;nbsp; System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +913&lt;BR /&gt;&amp;nbsp;&amp;nbsp; System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously) +165&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I disable the code that sets t he Proxy in the WMSLayer.ProxyUrl property everything works fine.&amp;nbsp;&amp;nbsp; Any insight?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ernie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 13:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/wms-problems-with-10-1-and-proxy-files/m-p/200221#M4940</guid>
      <dc:creator>ErnieSalazar</dc:creator>
      <dc:date>2013-06-07T13:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: WMS problems with 10.1 and Proxy files</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/wms-problems-with-10-1-and-proxy-files/m-p/200222#M4941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems the issue is in your proxy. You can't rely on the ContentLength that may be equals to -1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest code like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BinaryReader br = new BinaryReader(byteStream);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int length = (int)serverResponse.ContentLength;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (length &amp;lt; 0) length = 10000000;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] outb = br.ReadBytes(length);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; br.Close();&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/wms-problems-with-10-1-and-proxy-files/m-p/200222#M4941</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T09:58:30Z</dc:date>
    </item>
  </channel>
</rss>

