Webservice fix for error message - Maximum request length exceeded
19 March 2007So 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.
<system .web> <httpruntime maxRequestLength="8192" /> . . . </system>
This changes it from 4 MB to 8 MB (8192 KB)
No comments yet
Leave a Reply
You must be logged in to post a comment.
