Last post Jun 30, 2013 02:19 PM by rstrahl
May 28, 2013 07:38 AM|bazzer640|LINK
So, using ASP.Net 3.5, I've written an HTTP module (subscribing to BeginRequest), which works just fine. What it does isn't important (as I'll explain) but, for the sake of completeness, it checks incoming requests against a table of obsolete pages and,
where necessary, generates a 301 permanent redirect to somewhere more useful.
The problem is this: there's a web service (asmx) in the site, and with the http module implemented on the server (IIS 6), the asmx file can no longer be found (404). I've double-checked this by trying to browse to it, same result, it can't be found.
I've tried removing all the functional code from the module so that it is nothing more than a stub, and the problem persists i.e. the problem is not with what the module does, the problem is with its very existence. The web service used to work just fine,
and if I remove the line in the web config that registers the module, then the web service reverts to working just fine again.
I'm baffled by this, I thought that any request was supposed to proceed as normal after event-processing by an HTTP module, assuming that the module doesn't do anything to alter it? n.b. the rest of the site works fine, it's just the asmx file that can't
be found. All suggestions gratefully received.
Jun 24, 2013 03:24 PM|BorysG|LINK
You can try to implement the same functionality as in your module within Global.asax file and see what will happen. If it works, then either it is something with your config, e.g. decalred module in incorrect location.
Jun 30, 2013 02:19 PM|rstrahl|LINK
That does sound odd... BeginRequest handlers by themselves don't change anything in the request pipeline, so if there's no code in the module's implementation then it effectively shouldn't do anything. I would be inclined to say there's something else going
on even though it may seem like the module is at fault. As the other poster mentioned try implementing your logic in Application_BeginRequest() in global.asax and see if you get the same behavior.
Couple of other things to check: Does this happen both in dev and and on the Win2003 machine? Is it possible the live server has the ASMX extension not mapped (ie. explicitly removed) in which case you would get a 404.