I have a WCF service method I've implemented that gets passed an IEnumerable
[OperationContract]
List<Item> GetItems(DateTime sinceDate, IEnumerable<Guid> idList);
The method works as intended when passing in an IEnumerable of size 1000 or fewer; the service returns with an expected response. At some point, the array passed in is too large (seen at 2000 items) and a System.ServiceModel.ProtocolException
is thrown, "{"The remote server returned an unexpected response: (400) Bad Request."}"
I'm not sure what's governing the array size limitation. I'm aware of the readerQuotas section of a binding, and the maxArrayLength is set to the default 16384. My buffer sizes are set large enough, but I'm not sure why the service call is failing. Is there a limitation on the basicHttpBinding for array sizes passed in? What needs to change in my configuration so that I can pass in large arrays?
Here is my app.config in the client side. Server side is equivilant.
<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>