Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am building a WCF service with framework 4.0.
My web service returns a Dataset; Everything works fine if the Dataset is small but gives the following exception when the Dataset is bigger:

The maximum message size quota for incoming messages (65536) has been exceeded

In the old web services I use to set
What I have to do to simply modify web.config to set maxReceivedMessageSize property?

Here is the web.config as now :

XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  </system.web>

  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- Per evitare di diffondere informazioni sui metadati, impostare il valore riportato sotto su false e rimuovere l'endpoint dei metadati riportato sopra prima della distribuzione -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- Per ricevere i dettagli sull'eccezione per scopi di debug in caso di guasti, impostare il valore riportato sotto su true. Impostarlo su false prima della distribuzione per evitare di diffondere informazioni sull'eccezione -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>
Posted
Updated 21-Jul-13 22:35pm
v2

1 solution

Please include binding tag inside system.ServiceModel tag


<binding name="YourNameHere" maxReceivedMessageSize="2147483647"> </binding>
HTML

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900