Asked this on forums.asp.net but got no takers, so I thought I'd try here.
We've got an HttpModule that registers for BeginRequest, ReleaseRequestState, and EndRequest. The main purpose of the module is that when we're serving regular html pages, we want a hook to re-write and encrypt the query strings on hrefs in the generated html. The filtering is attached in the ReleaseRequestState event handler of our module (context.Response.Filter = new MyFilter(...);).
But when we're running a page that's going to result in an xml document, the ReleaseRequestState event handler doesn't appear to fire at all - only BeginRequest and EndRequest.
After a lot of googling, I found posts that say HttpApplication.CompleteRequest() will bypass a lot of the event chain and go directly to EndRequest, but nowhere do we call CompleteRequest(). So I'm thinking there are other things lower down that call it, or other ways of bypassing ReleaseRequestState.
When we set up to produce the report xml, we do a Response.Clear(); and then create an XmlWriter on Response.OutputStream. Would either of those cause something lower down to bypass the ReleaseRequestState event?