Cause:
A blank WCF service was established using. net4.5. The binding configuration used by default is basichttpsbinding.
Problem finding:
1, the service reference with the client, generated the default configuration file, where the binding configuration is BasicHttpBinding.
2, because a single pass of large quantities of data, so modify the binding configuration, as follows:
<BasicHttpBinding> <bindingname= "Basichttpbinding_iservice"Closetimeout= "00:10:00"ReceiveTimeout= "00:10:00"Sendtimeout= "00:10:00"MaxReceivedMessageSize= "2147483647"maxBufferSize= "2147483647" > <ReaderquotasmaxDepth= "2000000"Maxstringcontentlength= "2147483647"Maxarraylength= "2147483647"Maxbytesperread= "2147483647"Maxnametablecharcount= "2147483647" /> </binding> </BasicHttpBinding>
3, run the test, always prompt "413 Request Entity Too Large". Find information on the internet, basically said to modify the default size, the default is 4M, modify to be large enough. But I clearly already in the service side and the client have changed ah???
Problem solving:
Study for a long time to solve, directly say the result.
Under the framework of. NET 4.5, the default generated binding configuration is Basichttpsbinding, which is HTTPS, which is one more s.
However, I changed the binding configuration in HTTPS on the server, not the binding configuration of HTTP, but the HTTP in the client. So the final use of the default HTTP configuration, the size is 4M, the amount of data a large, natural error.
When it comes to this, the solution is obvious.
End:
HTTP is still low efficiency, try using TCP tomorrow.
. Research on the basichttpsbinding generated by default in WCF in NET4.5