Click here to Skip to main content
14,638,192 members
Rate this:
Please Sign up or sign in to vote.
See more:
Getting the following error when testing my wcf email service (this error happens *only* when sending a very large attachment through the new email service - obviously when the size of the attachment is larger than 65536):

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.

The question is, I am already setting the MaxReceivedMessageSize property in my web.config to a large value of 500000000, I also used the following code to set the binding in the code of the client itself as well as the service but no change:

BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
              binding.CloseTimeout = new TimeSpan(00, 5, 00);
              binding.OpenTimeout = new TimeSpan(00, 5, 00);
              binding.ReceiveTimeout = new TimeSpan(00, 5, 00);
              binding.SendTimeout = new TimeSpan(00, 5, 00);
              binding.TextEncoding = System.Text.Encoding.UTF8;
              binding.MaxReceivedMessageSize = 500000000; // int.MaxValue;
              binding.MaxBufferSize = 500000000; // int.MaxValue;


One thing to mention, having set the code above prior to calling the service, do I need to somehow associate the "binding" object with the message prior to calling the service?

Thanks for the help upfront.
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Solved! problem with behavior configuration, removed all of it and re created it.
   

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