Click here to Skip to main content
13,147,183 members (28,711 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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. 


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,
Posted 16-Feb-10 0:02am
Programm3r11.8K

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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,
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 16 Feb 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100