1

In WCF WebApi (Preview 6), Many of the WCF binding attributes have been moved into the configuration class. For example:

var config = new HttpConfiguration {MaxReceivedMessageSize = 250001};

What are the corresponding settings for <readerQuotas>? For example, how would I setup a configuration like:

    <binding name="largeLimits" maxReceivedMessageSize="250001">
      <readerQuotas maxStringContentLength="2147483647"/>
    </binding>
Jeff
  • 551
  • 3
  • 8
  • 1
    Had a look into the source code of the HttpConfiguration class and seems like there is no property or any code for ReaderQuotas. – Rajesh Jan 19 '12 at 11:18

1 Answers1

2

The ReaderQuotas property is specifically related to the processing of SOAP messages; according to MSDN, this property defines "constraints on the complexity of SOAP messages that can be processed by endpoints". However, Web API is not tied to SOAP, so this setting doesn't makes sense for it.

On the other hand, this quota could make sense when using the XmlMediaTypeFormatter, however it appears to be using XmlDictionaryReaderQuotas.Max (see http://wcf.codeplex.com/SourceControl/changeset/view/ee192ebdfb80#WCFWebApi%2fsrc%2fMicrosoft.Net.Http.Formatting%2fSystem%2fNet%2fHttp%2fFormatting%2fXmlMediaTypeFormatter.cs)

Pedro Felix
  • 1,056
  • 1
  • 8
  • 12
  • Thanks Pedro, I think you've nailed the problem. Specifically, we have properties whose values are long strings. Setting this property higher corrects the problem (allows the longer string through). Is this just something that isn't in the webapi preview yet? – Jeff Jan 23 '12 at 16:23