Web Service is an ASMX web service (NOT WCF)
I am receiving an error
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 using a proxy that Visual Studio generates for you when you add a "Web Reference" (please note that I am NOT adding "Service Reference", instead I am using Web Reference)... this creates a proxy that inherits from SoapHttpClientProtocol
Can anyone help me figure out how to set the equivalent to MaxReceivedMessageSize
for this method? (I am asking for the equivalent of doing HttpBinding.MaxReceivedMessageSize = Int32.MaxValue
if I were using WCF)
MaxReceivedMessageSize = 1000000; The value of this property can also be set in the configuration file.
You need to set the MaxReceivedMessageSize attribute in your binding configuration. By default, it is 65536.
The MaxReceivedMessageSize change can be done in the App.config file or in the source code before calling the service's method.
BasicHttpBinding httpBinding = youAddWebServiceName.ChannelFactory.Endpoint.Binding as BasicHttpBinding;
httpBinding.MaxReceivedMessageSize = int.MaxValue;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With