Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
<bindings>
<netMsmqBinding>
<binding>
 <readerQuotas>
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
<readerQuotas>

Defines the constraints on the complexity of SOAP messages that can be processed by endpoints configured with a binding.

<readerQuotas 
    maxArrayLength="Integer"
        maxBytesPerRead="Integer"
        maxDepth="Integer"
        maxNameTableCharCount="Integer"
    maxStringContentLength=="Integer" />

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

maxArrayLength

A positive integer that specifies the maximum allowed array length of data being received by Windows Communication Foundation (WCF) from a client. The default is 16384.

maxBytesPerRead

A positive integer that specifies the maximum allowed bytes returned per read. The default is 4096.

maxDepth

A positive integer that specifies the maximum nested node depth per read. The default is 32.

maxNameTableCharCount

A positive integer that specifies the maximum characters allowed in a table name. The default is 16384.

maxStringContentLength

A positive integer that specifies the maximum characters allowed in XML element content. The default is 8192.

Child Elements

None

Parent Elements

This element is the child element of all the standard bindings that come with Windows Communication Foundation (WCF).

The complexity constraints provide protection from denial of service (DOS) attacks that attempt to use message complexity to tie up endpoint processing resources. Other complexity constraints include items such as a maximum element depth and a maximum length for string content within the message.


© 2007 Microsoft Corporation. All rights reserved.
Last Published: 2010-01-05
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
MaxBytesPerRead clarification      Michael Freidgeim   |   Edit   |   Show History

The documentation is not clear, how MaxBytesPerRead is different from other limits, e.g. MaxBufferSize or MaxReceivedMessageSize.

From http://geeksdiary.com/archive/2007/05/23/pox-streaming.aspx :

The MaxBytesPerRead value indicates how many bytes the XmlDictionaryReader should read when reading the element start tag and its attributes. Therefore, this value should essentially be large enough to read that information. If you set an unnecessarily large value here, the XmlDictionaryReader.Read() method will not return until it receives enough bytes from the underlying transport(this could be problematic if you receive very small data chunks with a considerable amount of delay)

Tags What's this?: Add a tag
Flag as ContentBug
Carefull: maxStringContentLength Double Equal Sign error in xml      Marco Scheel   |   Edit   |   Show History

The XML Config shown has a simple bug that might be anoying if you copy paste into a notepad with existing data...
<readerQuotas
maxArrayLength="Integer"
maxBytesPerRead="Integer"
maxDepth="Integer"
maxNameTableCharCount="Integer"
maxStringContentLength=="Integer" />

maxStringContentLength has to equal signs where it should only have one!

maxStringContentLength      LukeSkywalker   |   Edit   |   Show History

So that the search engines can index this page (which is the answer), here's the common message given when MaxStringContentLength is too small.

The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'something'. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 8815.

Tags What's this?: wcf (x) Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker