Maximum message size quota for incoming messages exceeded (65536)

My WCF service has an OperationContract that takes an array of objects as a parameter. This could potentially be quite large. After searching for fixes for Bad Request: 400, I found the real reason: the maximum message size.

I know that this question was asked before in MANY places. I tried everything that says: "Increase the size in the client and server configuration files." I have. This still does not work.

My web.config service:

<system.serviceModel> <services> <service name="myService"> <endpoint name="myEndpoint" address="" binding="basicHttpBinding" bindingConfiguration="myBinding" contract="Meisel.WCF.PDFDocs.IPDFDocsService" /> </service> </services> <bindings> <basicHttpBinding> <binding name="myBinding" closeTimeout="00:11:00" openTimeout="00:11:00" receiveTimeout="00:15:00" sendTimeout="00:15:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" transferMode="Buffered" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> 

My app.config client:

 <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IPDFDocsService" closeTimeout="00:11:00" openTimeout="00:11:00" receiveTimeout="00:10:00" sendTimeout="00:11:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:8451/PDFDocsService.svc" behaviorConfiguration="MoreItemsInObjectGraph" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPDFDocsService" contract="PDFDocsService.IPDFDocsService" name="BasicHttpBinding_IPDFDocsService" /> </client> <behaviors> <endpointBehaviors> <behavior name="MoreItemsInObjectGraph"> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> 

What can I lose or do wrong? It is as if the service is ignoring what I entered in maxReceivedBufferSize.

Thanks in advance, Kyle

UPDATE

Here are two more StackOverflow questions in which they never received an answer:

https://stackoverflow.com/questions/2880623/maxreceivedmessagesize-adjusted-but-still-getting-the-quotaexceedexception-with

WCF MaxReceivedMessageSize Property Does Not Accept

+7
c # wcf
source share
2 answers

In the service configuration file, the attribute "name" is missing in the element

 <behaviors> <serviceBehaviors> <behavior name="StackOverflow"> 

and the service element should have a link to this name:

 <system.serviceModel> <services> <service behaviorConfiguration="StackOverflow" name="myService"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="myBinding" 

In general, it is recommended that you check, if not always, your WCF configuration files using the "WCF Service Configuration Editor", which is invoked from the Visual Studio Tools menu item.

In addition, endpoint behavior is not defined for the service. I do not know if this matters.

+7
source share

I had the same problem with WCF Test, and I installed the default configuration file. If there are no problems from your configuration file, I suggest trying to test this service using another program, for example: SOAP UI, I think this error is not from the service, it is from the WCF test.

0
source share

All Articles