pondelok 27. februára 2012

Error: The maximum message size quota for incoming messages (65536) has been exceeded.

This error has occurred, when I was calling simple method on WCF service.
I double checked my web.config on server side (IIS) and everything was fine.

But!!! the size 65536 was in client app.config! The client configuration was not reflecting server WCF configuration, changing maxReceivedMessageSize to e.g. 2147483647 is solution.


Code Snippet
  1. <system.serviceModel>
  2.     <bindings>
  3.       <basicHttpBinding>
  4.         <binding name="BasicHttpBinding_IeDocsInterfaceCUD" closeTimeout="00:10:00"
  5.           openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
  6.           allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
  7.           maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
  8.           messageEncoding="Mtom" textEncoding="utf-8" transferMode="Buffered"
  9.           useDefaultWebProxy="true">
  10.           <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
  11.             maxBytesPerRead="4096" maxNameTableCharCount="16384" />
  12.           <security mode="None">
  13.             <transport clientCredentialType="None" proxyCredentialType="None"
  14.               realm="" />
  15.             <message clientCredentialType="UserName" algorithmSuite="Default" />
  16.           </security>
  17.         </binding>

Žiadne komentáre:

Zverejnenie komentára