ServiceStack/ServiceStack — pull request #763 by pruiz (2013-07-07 09:01:09+00:00)
Title: Fixed SoapHandler.cs to preserve Request.Items entries set at (pre-)request filters until request get executed by service implementation.

When running SOAP-based services hosted by IIS, items set at IHttpRequest.Items by (pre-)request filters, are missing when the request reaches the actual service implementation (i.e. IService.Run(..)).

As said, this was a difficult one to catch, as this behaviour was only found when running SOAP services under IIS.. HttpListener runner works just fine.

After inspecting the code, it looks like this commit (https://github.com/ServiceStack/ServiceStack/commit/b86a7a9bd6745592a64d9d8f64adc19a69f0c0c0) introduced a regresion by re-creating the current IHttpRequest from HttpContext.Current.Request.

ServiceStack's HttpRequest.Items is a dictionary not backed by the underlaying Sys.Web.HttpRequest object, and as such, a new instance of ServiceStack's HttpRequest will get an empty Items collection.

I've added an integration test demostrating the issue, and which test this behaviour against all transports (JSV, JSON, SOAP, etc.)