So I ran into the classic “Maximum message size exceeded” error with a WCF service I am working on. Strangely though, setting all the message size settings way up as other posts suggest doesn’t seem to do anything; I still get the same error.
Here is my server config. The client isn’t .net, so there is no client config.
Any ideas?
<services>
<service name="MyService" behaviorConfiguration="HTTPMetadataBehavior">
<endpoint address="http://localhost:2624" binding="webHttpBinding"
bindingConfiguration="WebHttpSettings" contract="IMyService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="HTTPMetadataBehavior">
<serviceMetadata httpGetEnabled="true" httpGetBinding="webHttpBinding"
httpGetBindingConfiguration="" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="WebHttpSettings" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>
Okay this fix won’t work for everyone, but for me I made my configuration the default for webHttp by omitting the name and that worked. Here is the revised config.