I've got a WCF service that is working for basic queries. I started with simply the default out of the box bindings (WSHttpBinding with default values).
The data-contract is for an array of custom objects, each object comes to about 6k in size. When I send up to 5 of these (in a single transaction), it works fine. When I attempt to send 6 or more, I get this error:
"The remote server returned an error: (400) Bad Request."
I researched bindings some, and tried setting the configurations on the client like this:
<binding name="WSHttpBinding_IASRService" closeTimeout="00:10:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="50000000" maxStringContentLength="50000000"
maxArrayLength="50000000" maxBytesPerRead="50000000"
maxNameTableCharCount="50000000" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
</binding>
I similarly set the configurations on the services web.config file, however, the problem still persists.
I also tried to set the client app.config to messageEncoding="Mtom", but that generated another binding error, saying the bindings may be mismatched between client and server, so I took that out for now. (Although Mtom was also specified at the server web.config.) Also, in my research, I have not yet found a clear simple description of each of the binding properties.
In summary, I'm trying to answer the following questions:
- How to get larger requests to not generate the bad request error
- How to set client to Mtom without generating error
- Is there a good basic reference on each of the binding properties and how to use them?