ServiceModel.CommunicationException:已超过最大名称表字符数配额(16384) [英] ServiceModel.CommunicationException: maximum nametable character count quota (16384) has been exceeded

查看:102
本文介绍了ServiceModel.CommunicationException:已超过最大名称表字符数配额(16384)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用Exchange Web服务(Exchange 2010版).问题是我不断收到以下异常:

Hi all,

I am making use of Exchange Web Services (Exchange version 2010). The problem is that I keep receiving the following exception:

Error in deserializing body of reply message for operation ''GetUserAvailability''.
The maximum nametable character count quota (16384) has been exceeded while reading XML data. 



我已经在Google上进行了检查,并尝试了各种方法来修复它,但均未成功.这包括增加客户端应用程序配置文件中各种readerQuotas值(maxStringContentLength,maxArrayLength等)的大小. :confused:

当我使用Fiddler时,可以在响应中看到正确的数据,但是反序列化始终崩溃.任何人都可以指出正确的方向吗?



I have checked this on Google and tried all the various methods to fix it without success. This included increasing the size of the various readerQuotas values (maxStringContentLength, maxArrayLength, etc.) in the client app config file. :confused:

When I make use of Fiddler I can see the correct data in the response, but the deserialization keeps crashing. Can anyone please point me in the right direction?

<br />
<pre><br />
            BasicHttpBinding binding = new BasicHttpBinding();<br />
            binding.Security.Mode = BasicHttpSecurityMode.Transport;<br />
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;<br />
            binding.MaxReceivedMessageSize = 50000000;<br />
            EndpointAddress endpoint = new EndpointAddress(new Uri("https://server/EWS/Exchange.asmx"));<br />
            ExchangeServicePortTypeClient ews = new ExchangeServicePortTypeClient(binding, endpoint);<br />
</pre><br />



提前非常感谢.
亲切的问候,



Many thanks in advance.
Kind regards,

推荐答案

添加以下以粗体显示的代码-解决了我的问题:

Add the following code that appears in bold - solved my problem:

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



亲切的问候,



Kind regards,


这篇关于ServiceModel.CommunicationException:已超过最大名称表字符数配额(16384)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆