.net - WCF - How to Increase Message Size Quota -


i have wcf service returns 1000 records database client. have asp.net wcf client (i have added service reference in asp.net web application project consume wcf).

i following message when run client application:

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

any help? how increase message size quota?

you'll want increase message size quotas, in app.config or web.config file:

<bindings>     <basichttpbinding>         <binding name="basichttp" allowcookies="true"                  maxreceivedmessagesize="20000000"                   maxbuffersize="20000000"                  maxbufferpoolsize="20000000">             <readerquotas maxdepth="32"                   maxarraylength="200000000"                  maxstringcontentlength="200000000"/>         </binding>     </basichttpbinding> </bindings> 

and use binding name in endpoint configuration e.g.

... bindingconfiguration="basichttp" ... 

the justification values simple, sufficiently large accommodate messages. can tune number fit needs. low default value there prevent dos type attacks. making 20000000 allow distributed dos attack effective, default size of 64k require large number of clients overpower servers these days.


Comments