By default, ASP.NET 2.0 has a default maximum request length of 4MB configured in machine.config. This value can be changed directly in machine.config or overridden in the service application's web.config:
- if the size of the message is greater than BOTH values, this exception is thrown by the service:
System.ServiceModel.CommunicationException: Maximum request length exceeded. ---> System.Web.HttpException: Maximum request length exceeded. - if the size of the message is greater than httpRuntime.maxRequestLength but less than WCF's binding.maxReceivedMessageSize, the same exception above is thrown.
- if the size of the message is less than httpRuntime.maxRequestLength but greater than WCF's binding.maxReceivedMessageSize, the client receives a "The remote server returned an unexpected response: (400) Bad Request." excception. Nothing is logged on the server.
- if the size of the message is less than BOTH values, it works!