<?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 QueryTask fails with large feature count in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/querytask-fails-with-large-feature-count/m-p/21439#M241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After increasing LocalMapService.MaxRecords to 100,000 (from default 1000) to get all features for a particular sub-layer, I'm now getting an exception with the following message when querying against a large featureSet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"Cannot write more bytes to the buffer than the configured maximum buffer size: 104857600."&lt;/STRONG&gt;&amp;nbsp; (0x6400000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to be able to query all features for a particular layer/sub-layer.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Where is this max buffer size defined?&amp;nbsp; Is there a way to increase this maximum buffer size through the API or maybe in a file somewhere? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Oct 2015 16:42:20 GMT</pubDate>
    <dc:creator>ColinWyatt</dc:creator>
    <dc:date>2015-10-26T16:42:20Z</dc:date>
    <item>
      <title>QueryTask fails with large feature count</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/querytask-fails-with-large-feature-count/m-p/21439#M241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After increasing LocalMapService.MaxRecords to 100,000 (from default 1000) to get all features for a particular sub-layer, I'm now getting an exception with the following message when querying against a large featureSet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"Cannot write more bytes to the buffer than the configured maximum buffer size: 104857600."&lt;/STRONG&gt;&amp;nbsp; (0x6400000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to be able to query all features for a particular layer/sub-layer.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Where is this max buffer size defined?&amp;nbsp; Is there a way to increase this maximum buffer size through the API or maybe in a file somewhere? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 16:42:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/querytask-fails-with-large-feature-count/m-p/21439#M241</guid>
      <dc:creator>ColinWyatt</dc:creator>
      <dc:date>2015-10-26T16:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask fails with large feature count</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/querytask-fails-with-large-feature-count/m-p/21440#M242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this exception is being raised by the underlying System.Net.Http.HttpClient used by the QueryTask.There's a solution to this error described here: &lt;A href="http://stackoverflow.com/questions/18720435/httpclient-buffer-size-limit-exceeded" title="http://stackoverflow.com/questions/18720435/httpclient-buffer-size-limit-exceeded"&gt;.net - HttpClient buffer size limit exceeded - Stack Overflow&lt;/A&gt;, but it's only relevant if you have direct control over the HttpClient in your code (rather than going through the QueryTask, ie.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect your best approach might be to try to make the response as lean as possible. If you don't need the geometry for the features, for example, you could set ReturnGeometry = false. A good start might be to restrict the fields that are returned by the query by setting the Query.OutFields property to only those you'll need in your app. If you need additional information later (geometry or attributes for a specific feature, for example) you could re-query for the extra information (maybe using the ObjectID).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 20:29:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/querytask-fails-with-large-feature-count/m-p/21440#M242</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2015-10-26T20:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask fails with large feature count</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/querytask-fails-with-large-feature-count/m-p/21441#M243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The upper limit for the buffer should be 2147483647 (i.e. &lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;Maximum value for a variable of type int).&amp;nbsp; The default value will be most likely be the &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;104857600 value you're seeing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HttpClient.MaxResponseContentBufferSize Property&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/hh193642" title="https://msdn.microsoft.com/en-us/library/hh193642"&gt;https://msdn.microsoft.com/en-us/library/hh193642&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran into this error once before while downloading some rather large mobile geodatabases from a feature service. In my code I instantiate the client as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14459005736373865 jive_text_macro" data-renderedposition="195_8_912_16" jivemacro_uid="_14459005736373865"&gt;&lt;P&gt;var client = new ArcGISHttpClient { MaxResponseContentBufferSize = 2147483647, Timeout = TimeSpan.FromMinutes(0.5) };&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 23:02:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/querytask-fails-with-large-feature-count/m-p/21441#M243</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-10-26T23:02:58Z</dc:date>
    </item>
  </channel>
</rss>

