I have a WCF service (more webHttpBinding) using ASP.NET 4 / IIS 8, and I had no problems communicating with it using JSON with GET. However, today I needed to implement a method that sends a large query string (about 3000 characters, but not so long, but longer than I used). I called the service and immediately got a 404 error, without even fitting into my code on my debug machine. The first thing that occurred to me was the maximum limit on the length of the query string. I added this to my web.config:
<system.webServer>
<directoryBrowse enabled="true" />
<security>
<requestFiltering>
<requestLimits maxQueryString="8000"></requestLimits>
</requestFiltering>
</security>
</system.webServer>
Now I get this server error when I call the service: The length of the query string for this request exceeds the configured maxQueryStringLength value.Quite strange, I tried other values, such as 200000by my query string and URL, which is about 3000 characters. Did I miss something?
source
share