You may find yourself in the same situation as I was this evening when dealing with large amounts of data being passed across to a WCF Data Service Operation. It just kept failing with a 404 Error as if the service is not there.

This was coincidentally the same issue I had last September when working with Uploadify and you can read more about those adventures here

The problem occurs when you are passing across a large string of data as a parameter to a WCF Data Service Operation, say 4k of data. If you are like me when you are working on your development box on Windows 7 you may not install Request Filtering for IIS.

It is the Request Filtering that was configured by whomever commissioned the Production server that was causing the issue. Not that it’s a bad thing, Request Filtering can be good but it’s a gotcha that you need to be aware of.

Going through my debugging process I could see on the NET panel in Firefox and also through Fiddler that a 404 was being raised whenever I tried to pass a larger than normal amount of data.

It was my colleague that got me going on the right track when he suggested that perhaps there was something in the external firewall that was blocking the large request. Not having any control of the firewall it was tricky to debug so I set about narrowing down the problem.

I installed Microsoft Network Monitor 3.4 (you can download it from here) on the server which I did have access to. At least then I could determine if the request was actually coming through to IIS.

Microsoft Network Monitor 3.4

As shown above (sample data) you can see individual requests coming through including protocol, source IP and destination IP. Everything I needed to debug the issue and this proved that the firewall was not blocking the requests.

So it had to be some configuration on the machine and it was then that I remembered Request Filtering. You can see this in IIS7 below:

IIS 7 Request Filtering

If you Open this feature, select the URL tab and then Edit Feature Settings as shown below this is where that pesky setting lives for Maximum URL Length. As soon as I upped that, all was well.

Request Filtering Settings

Hope that helps some poor soul and if it me stumbling across this article on Google in 6 months time, “maybe it will sink in this time?”.

BondiGeek