Reputation: 13985
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:
Upvotes: 2
Views: 892
Reputation: 13985
I finally figured this out!
On SO of all places, see this question
That solved my main issue (#1). I'm still looking for a clear description of how to configure the various binding WCF properties. I've looked online, in books, and at the API docs at MSDN. If anyone knows of something that really spells it out, please post it here. It seems like WCF is fairly straight forward, until you get into the binding details.
Upvotes: 1
Reputation: 4401
Here's a tip i learned the hard way for your #2:
Every time you make a change to WCF on the server side, recompile the server project then "Update Reference" on the client side (right click service reference).
Upvotes: 2
Reputation: 1040
Your best bet for getting started debugging, would be to take an operational approach. I'd pull out Fiddler, and make sure the the client is sending a valid request.
Upvotes: 1