Can't change maxReceivedMessageSize from default in Config file

Can't change maxReceivedMessageSize from default in Config file

Old forum URL: forums.lhotka.net/forums/t/4369.aspx


dlabar posted on Tuesday, February 19, 2008

In trying to implement CSLA with WCF, I'm running into this error:

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

I google and see oh, I need to increase the default size to something larger, so I change both my App.config file for my Windows form client and my Web.Config for the WCF Portal to the following values for the <system.serviceModel> elements:

Web.Config:

<system.serviceModel>

<bindings>

<wsHttpBinding>

<binding name="wsHttpBindingSettings" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" messageEncoding="Text">

<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

</binding>

</wsHttpBinding>

</bindings>

<services>

<service name="Csla.Server.Hosts.WcfPortal">

<endpoint contract="Csla.Server.Hosts.IWcfPortal" binding="wsHttpBinding"/>

</service>

</services>

</system.serviceModel>

 

App.config:

<system.serviceModel>

<bindings>

<wsHttpBinding>

<binding name="wsHttpBindingSettings" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" messageEncoding="Text">

<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

</binding>

</wsHttpBinding>

</bindings>

<client>

<endpoint name="WcfDataPortal" address="http://localhost/G2DotNetDataPortal/WcfPortal.svc" binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal" />

</client>

</system.serviceModel>

But even though I have the max received message size set to 2147483647 on the client, it still is giving me the error with 65536 listed as the quota value.  I've recompiled the solution and reset IIS, but it still isn't increasing the quota size and keeps on giving me the 65536 quota size error.

 

What else can I check?  What else can I do?

dlabar replied on Tuesday, February 19, 2008

I've discovered the issue.

 

I didn't define my bindingConfiguration attribute in my end point

 

<endpoint name="WcfDataPortal" address="http://localhost/G2DotNetDataPortal/WcfPortal.svc" binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal" bindingConfiguration="wsHttpBindingSettings" />

 

Thank you to anyone that spent anytime looking at this.  Hope this helps someone else down the road as well!

Curelom replied on Tuesday, February 19, 2008

You also need to change the size of the reader quota

 

          <readerQuotas maxDepth="32" maxStringContentLength="655360" maxArrayLength="2147483647"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />

Curelom replied on Tuesday, February 19, 2008

Nevermind then Wink [;)]

Copyright (c) Marimer LLC