IEnumerable を渡される実装済みの WCF サービス メソッドがあります。
[OperationContract]
List<Item> GetItems(DateTime sinceDate, IEnumerable<Guid> idList);
サイズが 1000 以下の IEnumerable を渡す場合、このメソッドは意図したとおりに機能します。サービスは期待される応答を返します。ある時点で、渡された配列が大きすぎて (2000 アイテムで表示)、 aSystem.ServiceModel.ProtocolException
がスローされます。"{"The remote server returned an unexpected response: (400) Bad Request."}"
配列サイズの制限を支配しているものはわかりません。バインディングの readerQuotas セクションを認識しており、maxArrayLength がデフォルトの 16384 に設定されています。バッファ サイズは十分に大きく設定されていますが、サービス コールが失敗する理由がわかりません。渡される配列サイズの basicHttpBinding に制限はありますか? 大きな配列を渡すことができるようにするには、構成で何を変更する必要がありますか?
これがクライアント側の私の app.config です。サーバー側は同等です。
<binding name="BasicHttpBinding_IMyService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="20000000" maxBufferPoolSize="524288" maxReceivedMessageSize="20000000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>