Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Maximum Message Size Quota

I'm trying to call a WCF service (hosted in a Windows Service, not IIS) and am getting the following error:

The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details.

I have tried increasing the MaxReceivedMessageSize and the ReaderQuotas to their maximum values without any luck.

I have also turned on logging and checked the messsage size that's getting "sent." It's definitely nowhere near the maximum. We're talking about sending an object that serialized into 372KB XML.

Two questions:

  1. Does anyone know what "server logs" the message is referring to? I've checked the EventViewer but nothing shows up there...

  2. Does anyone know what other configuration setting(s) might apply here?

like image 216
reustmd Avatar asked Nov 10 '09 15:11

reustmd


2 Answers

Your question reminded me of a blog post by Shawn Wildermuth where he was having trouble with Large Message Sizes in a Silverlight application. Perhaps this will help you out:

http://wildermuth.com/2009/09/10/Using_Large_Message_Requests_in_Silverlight_with_WCF

Shawn says:

The trick is to change the customBinding in the web.config to use larger defaults. I picked 2MB as it its a reasonable size. Of course setting them to 2GB like shown above will work but it does leave you more vulnerable to attacks. Pick a size that isn't larger than your largest request but isn't overly large. Its a guessing game. To set these, you need to add them to your web.config is to put them on the httpTransport node:

like image 140
Ben McCormack Avatar answered Oct 14 '22 00:10

Ben McCormack


I think server logs means the tracing and logging files which are created when you turn that on. Here's the MSDN link.

The properties which I run into with WCF that need to have a higher value in the applications I write are maxReceivedMessageSize, maxStringContentLength, maxArrayLength and maxBufferSize. Try to increase them and see what happens. WCF can be a pain to debug as it is fond to swallow exceptions.

like image 43
BennyM Avatar answered Oct 14 '22 01:10

BennyM