Click here to Skip to main content
14,635,966 members
Rate this:
Please Sign up or sign in to vote.
See more:
hello....

am facing little bit problem over here... due to buffer size i changed my web.config like this..

<?xml version="1.0"?>
<configuration>  
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="Service1" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="wsHttpBinding" name="wsHttpNBinding" bindingConfiguration="TransportSecurity" contract="IService1" ></endpoint>
        <endpoint address="mex" binding="mexHttpBinding"  name="mexHttpNBinding" contract="IMetadataExchange"></endpoint>
      
      </service>
    </services>
    <bindings>     
      <wsHttpBinding>   
        <binding name="TransportSecurity" maxReceivedMessageSize="2147483647"  maxBufferPoolSize="2147483647" 
                  closeTimeout="02:00:00" openTimeout="02:00:00" receiveTimeout="02:00:00" sendTimeout="10:00:00">
          <readerQuotas maxDepth="2147483647"
               maxArrayLength="2147483647"
               maxStringContentLength="2147483647"/>
          <security mode="None"  >
            <transport clientCredentialType="None" proxyCredentialType="None"   ></transport>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <!--<modules runAllManagedModulesForAllRequests="true" />-->
    <directoryBrowse enabled="true" />
  </system.webServer>
</configuration>


but while am consuming it.. again its coming to default size.. like this

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="wsHttpNBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                    transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="None">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost/sample/Service1.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpNBinding"
                contract="IService1" name="wsHttpNBinding" />
        </client>
    </system.serviceModel>



soo am unable to use this service in my project..

error is

" 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. "
Posted
Updated 16-Jun-13 23:43pm
v3
Rate this:
Please Sign up or sign in to vote.

Solution 2

change client quota from (65536) to (2147483647) as on server you will able to use
   
v2
Comments
Lokesh Kondapalli 17-Jun-13 6:15am
   
i hosted my service in lapy-1 and am using this service in lapy-2... in lapy-2 using wcf test client.. i changed its working but when am using in my project.. am unable to change that setting.. how to change client quota ?
deepakkavi 17-Jun-13 7:18am
   
are you adding reference of your service (Service Reference) to your application? if yes
then you could found, there is some setting in you app config or web config file
change the quota size there it will work
Rate this:
Please Sign up or sign in to vote.

Solution 3

just i changed my project(where am consuming my wcf service) web.confige file means

in System 1- my service hosted
in System 2- my project consuming that wcf service.. in my project web.config file i changed.. make sure... ur size's same in service web.config as well as project web.config and thq u to al

just for refer

http://rocksolidknowledge.com/ScreenCasts.mvc/Watch?video=WCFLargeMessages.wmv[^]
   
v2
Comments
Member 10281217 29-May-15 9:17am
   
I tried to increase the value for maxReceivedMessageSize, but then also getting the exception:

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

Can anybody please help here.
Lokesh Kondapalli 30-Dec-15 12:22pm
   
Are you testing in WCFTestClient ? or in other application by adding service reference ?

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100