i am making a web service(Wcf) for my university management project.i am having some difficulties when i receive large amount of data from database it gives me following exception
Exception: 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
i am aware of this exception i have modified my web.config so that i can receive large amount of data here is my web.config:
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtTransportLevel="true" />
<endToEndTracing activityTracing="true" />
</diagnostics>
<bindings>
<wsHttpBinding>
<binding name="secureWsHttpBinding" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="524288000" messageEncoding="Mtom">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message algorithmSuite="TripleDes" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<protocolMapping>
<remove scheme="http" />
<add scheme="https" binding="wsHttpBinding" bindingConfiguration="secureWsHttpBinding"/>
</protocolMapping>
i have set maximum values in my server side web.config file
after modifying my web.config i updated my Service Reference and visual studio Generate my Client side configuration in app.config
here is my app.config file :
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IAcdmcYrAdding" messageEncoding="Mtom">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
<binding name="WSHttpBinding_IAdd_EmployeeRecord" messageEncoding="Mtom">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<endpoint address="https://khurram/AlahsaanDSL.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IAcdmcYrAdding" contract="DSL.IAcdmcYrAdding"
name="WSHttpBinding_IAcdmcYrAdding" />
<endpoint address="https://khurram/AlahsaanDSL.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IAdd_EmployeeRecord" contract="DSL.IAdd_EmployeeRecord"
name="WSHttpBinding_IAdd_EmployeeRecord" />
</client>
</system.serviceModel>
Note: in my Client Configuration i have lots of bindings and endpoints i do not want to configure every end point.
**My Question:- Is there any way by which visual studio generate my app.config file like this**
<binding name="WSHttpBinding_IAcdmcYrAdding" maxBufferPoolSize="2147483647"maxReceivedMessageSize="2147483647"messageEncoding="Mtom"><readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />