WCF フレームワークによる既定の設定です。WCF REST サービスからより大きなデータ セットを取得するには、クライアント側とサーバー側の両方で以下に示すように、readerQuotas を増やす必要があります。
<binding maxBufferPoolSize="655360" maxReceivedMessageSize="655360">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
以下に示すように、maxItemsInObjectGraph を大きな値に設定することも検討してください。
<behavior>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
以下に示すように、コードを介して上記を実現できます。
コードを介してすべてを構成しているため、以下に示すように、コードを使用して readerQuotas を定義することもできます。
Binding binding = new WebHttpBinding();
binding.MaxBufferSize = 2147483647;
binding.MaxReceivedMessageSize = 2147483647;
var myReaderQuotas = new XmlDictionaryReaderQuotas();
myReaderQuotas.MaxStringContentLength = 2147483647;
myReaderQuotas.MaxDepth = 2147483647;
myReaderQuotas.MaxArrayLength = 2147483647;
myReaderQuotas.MaxBytesPerRead = 2147483647;
myReaderQuotas.MaxNameTableCharCount = 2147483647;
binding.GetType().GetProperty("ReaderQuotas").SetValue(binding, myReaderQuotas, null);
ブラウザでデータを取得しようとしている場合、クライアントとして .NET アプリを使用している場合は、サーバーに指定されているのと同じ readerQuotas を定義する必要があると思います。
以下に示すように、クラスに ServiceBehavior 属性を追加することにより、コードを介して maxItemsInObjectGraph を設定できます。
[ServiceContract]
[ServiceBehavior(MaxItemsInObjectGraph = 2147483647)]
public class Test
{
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
CatalogResults SearchBoxADO(string requestBox);
}