WCF - The maximum nametable character count quota (16384) has been exceeded while reading XML data

前端 未结 4 1231

I\'m having a WCF Service that uses wsHttpBinding. The server configuration is as follows :


      &l         


        
4条回答
  •  一生所求
    2020-12-17 22:22

    I know it has been a while, but I got the same problem and found other (simpler) solution in codeproject

    In the solution given there the values are set in the code rather than the .config file.

            BasicHttpBinding binding = new BasicHttpBinding();
            binding.Security.Mode = BasicHttpSecurityMode.Transport;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
            binding.MaxReceivedMessageSize = 50000000;
            binding.ReaderQuotas.MaxArrayLength = 50000000;
            binding.ReaderQuotas.MaxStringContentLength = 50000000;
            binding.ReaderQuotas.MaxNameTableCharCount = 50000000;
            EndpointAddress endpoint = new EndpointAddress(new Uri("https://server/EWS/Exchange.asmx"));
            ExchangeServicePortTypeClient ews = new ExchangeServicePortTypeClient(binding, endpoint);
    

    However, I changed the values in the relevant values in the .config file ( in both the and the sections) and solved the problem (rather than adding custom bindings):

                    
                        
                        
                            
                            
                        
                    
    

    I hope this will help somebody :)

提交回复
热议问题