1
我有一個WCF服務器,發送大數據到WCF - (413)請求實體過
當我連接的客戶端(WinForm的)我的代碼集,此代碼綁定參數:
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));
此代碼正常運行,但現在我需要在陣列發送一個非常大的數據,當我嘗試發送一個大陣列我有這樣的錯誤:
(413)請求實體過
我需要通過代碼配置此連接,而不是通過xml。
我已經foud例如僅通過XML解決這個一點改進,但我需要用C#代碼來設置
需要設置任何參數在web.config中(WCF服務器端)?
確實[這個堆棧溢出問題(http://stackoverflow.com/questions/12951763/maximum-request長度超出在wcf)不回答你的? – strickt01
我嘗試但不運行@ strickt01 – daniele3004