I need to change the maxStringContentLength to a value larger than 8192 but have not been successful in doing it. My WCF service will generate an exception if the amount of
update your client side config too. Set Reader's quota in and its attributes in the binding section.
By default, the latest version of WCF does in fact setup defaults and json is the default. What wasn't clear was what kind of default binding WCF was using. It turns out to be webHttpBinding. You will also see a ton of examples on the web showing attributes being applied to the service method, such as [WebGet]. The method requires no attributes at all. For maxStringContentLength to take affect, you need to correctly setup the binding and behavior. Here is the correct entries in the web.config file:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="jsonBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="DevServiceBehavior" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="DeveloperService" behaviorConfiguration="DevServiceBehavior" >
<endpoint address="" binding="webHttpBinding" contract="DeveloperService" bindingConfiguration="webHttpBindingDev" behaviorConfiguration="jsonBehavior">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webHttpBindingDev">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>