Webservice fix for error message - Maximum request length exceeded

By Tony - Last updated: Monday, March 19, 2007 - Save & Share - Leave a Comment

So I ran into a weird error this morning on one of my webservices. It was a SOAP exception which yielded a 500 HTTP Status error (as viewable from the trace.axd)

“There was an exception running the extensions specified in the config file. –> Maximum request length exceeded.”

The WebService call was posting a DataSet to a WebMethod. I figured out that the DataSet that I was posting was larger than 4MB (4096 KB) which happens to be the default maximum request length for posting to ASP.NET web applications.

You can change this to fix the problem. It is important to note the reason there is a limit in the first place … this setting is there to help protect against DOS attacks. So take precaution when changing this on internet web applications

To increase the default posting limit for your web application. Just add / change the httpRuntime section inside of the system.web element.



   . . . 

This changes it from 4 MB to 8 MB (8192 KB)

Posted in ASP.NET, Web • • Top Of Page

Write a comment

You need to login to post comments!