I have a WCF server,
when I connect the client (WinForm), I set the binding parameter with this code:
String HTTP_SERVER = http:\\....... private static BasicHttpBinding getBinding() { //WSHttpBinding binding = new WSHttpBinding(); BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None); binding.TextEncoding = System.Text.Encoding.UTF8; binding.ReaderQuotas.MaxArrayLength = int.MaxValue; binding.ReceiveTimeout =new TimeSpan(8, 0,0); binding.SendTimeout = new TimeSpan(8, 0, 0); binding.MaxReceivedMessageSize = int.MaxValue; binding.MaxBufferSize = int.MaxValue; binding.MaxBufferPoolSize = int.MaxValue; binding.ReaderQuotas.MaxDepth = 64; binding.ReaderQuotas.MaxArrayLength= int.MaxValue; binding.ReaderQuotas.MaxStringContentLength = int.MaxValue; return binding; } ConnectionToServer = new ConnectionToServer (getBinding(), new EndpointAddress(HTTP_SERVER));
This code works correctly, but now I need to send very large data to Array, and when I try to send a large array, I have this error:
(413) It is too difficult to query an entity
I need to configure this connection by code, not by xml.
I have an example to solve this problem only with xml, but I need to install C # code
Need to set any parameter in web.config (server side WCF)?
source share