We’ve seen this in the labs and also reported by our customers on the forums, If you try to post a large amount of data to an astoria data service , you might receive a response code Http 400 Bad Request even though the response data is valid. An ADO.NET Data Service sits on top of Windows Communication Foundation , although most of the required plumbing is hidden away from you , you can still see the effects in scenarios such as this .
a)The maximum size of the request which a WCF service can process is controlled by the MaxReceivedMessageSize property on the WCF binding. The default value is 65536 ,exceeding which you get the 400 response code. In the web.config of the web site hosting the service , add the following node in the <System.ServiceModel> section.
<!-- The name of the service -->
<!-- you can leave the address blank or specify your end point URI -->
<endpoint address ="YourServiceEndpoint"
<!-- configure the maxReceivedMessageSize value to suit the max size of
the request ( in bytes ) you want the service to recieve-->
<binding name="higherMessageSize" maxReceivedMessageSize ="MaxMessageSize"/>
b) If hosted on IIS , the ASP.Net Request Size restriction can also cause a large request to be rejected, You will need to set the HttpRuntimeSection.MaxRequestLength Property.
<httpRuntime MaxRequestLength="ValueInKiloBytes" />
Identify if WCF is throwing an exception under the covers which is not being surfaced to you at the HTTP level. You can configure WCF tracing on the server-side to log the necessary information from the WCF layer. Once you have tracing setup and you reproduced the failure , check if the log contains one or both of these exception messages.
"The maximum message size quota for incoming messages (65536) has been exceeded.
To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element."
"Maximum request length exceeded."
If you see that the log does contain this message , then you can be sure that the failure is because of the message size and apply this fix accordingly.
Astoria & IIS , HTTP 400 Bad Request on Posting Large Payloads to an astoria service AstoriaはWCFベースなので、WCF側の設定項目の変更が必要になる、という話です。...
Great explanation of a problem that's foxed me for the last 4 hours. Thanks for providing me with the solution!
same issue great post ; saved my day dude; I can go home happy.
I am exactly getting the same issue, but not resolved after modifying the way its specified. ANy other known issues?