?
Solved

Setting binding maxReceivedMessageSize in WCF having no effect

Posted on 2014-04-22
3
Medium Priority
?
1,550 Views
Last Modified: 2014-04-30
I am setting up a chain of WCF services to provide a data access  layer supporting a  business rules layer supporting the UI layer and am having trouble with setting up the bindings (using code, not a config file).

I get the following error:

Additional information: 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.

This is despite setting the MaxReceivedMessageSize (and, for good measure, the MaxBufferSize) to a higher value for the bindings at each level (host and client). The code I am using is shown in the attached document.

Can anyone help, please.
ExpertsExchangeSupport1.docx
0
Comment
Question by:smucRJG2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Assisted Solution

by:dj_alik
dj_alik earned 1000 total points
ID: 40016666
In your host program you need to set the reader quotas  and then add the binding
netBind.Security.Mode = SecurityMode.None
            netBind.MaxBufferPoolSize = 524288
            netBind.MaxReceivedMessageSize = 2147483647
            netBind.MaxBufferSize = 2147483647
            netBind.ReaderQuotas.MaxDepth = 64
            netBind.ReaderQuotas.MaxArrayLength = 2147483647
            netBind.ReaderQuotas.MaxStringContentLength = 2147483647
Make sure that the same maxReceiveMessageSize parameter at the client side also.
The exception clearly indicates that maxReceivedMessageSize is exceeded. Try to capture the WCF traces at verbose level and check what binding configuration is applied on endpoint.
Recheck the client and service configuration and if still no clue, capture traces for service and client at verbose level.

WCF Tracing FAQs
http://www.codeproject.com/Articles/36031/WCF-Tracing-FAQs
0
 

Accepted Solution

by:
smucRJG2 earned 0 total points
ID: 40020136
I think I may have found the answer for my particular case. I was chaining  projects in Visual Studio:
Data Access Service project >> Console hosting project (just for testing)    [solution 1]
>>
Business Service project >> Console hosting project (just for testing)         [solution 2]
>>
UI project      [solution 3]

This way it is possible to step through the complete chain, without using a config file or WCF Test Client, using code needing only minor adjustment before for insertion into final production hosting environment.

After changes to, say, the Data Access Service project I needed to rebuild the project and then remove and re-add the referenced DLL for the project in the associated Console hosting project. This seems to work consistently.

Thank you for the answer - I will keep it in reserve in case I have further problems.
0
 

Author Closing Comment

by:smucRJG2
ID: 40031568
Basically, my solution worked.
Also, I had already spent a lot of time Googling the issue and know that many factors can cause this sort of problem - so dj_alik's response was also a possiblility and relevant (as I had already checkedthat client and server settings were the same).
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question