WCF Maximum Message Size Quota

南楼画角 提交于 2019-12-05 05:32:55

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:

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.

You can specify the server logs and path in the application config as follows

 <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.ServiceModel"

                    switchValue="Critical, Error, Warning"
              >
        <listeners>
          <add name="traceListener"
                        type="System.Diagnostics.XmlWriterTraceListener"
                        initializeData="F:\log-data\ServiceTrace.svclog"
            />
        </listeners>
      </source>
    </sources>

  </system.diagnostics>

Two things:

  • can you show us the server and client side config (just the relevant sections - endpoints, binding configuration)

  • did you change the values on both sides (client and server)??

There's a whole plethora of size settings you can influence....

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!