Question

I have an ASP.NET website and am having trouble capturing some specific requests that are giving me trouble. The website calls an asmx web service that it also hosts (therefore makes a webservice call to (http://localhost/whatever.asmx)). I'm getting a 400: Bad Request back, so I want to figure out exactly what request is being made.

I can't use something like wireshark, because it's a call to localhost. What I'm trying now is implementing and registering a HttpModule to log requests. I don't think my HttpModule is getting called for these requests, but when I try on another machine where the request goes through, it gets hit every time.

Does IIS return with 400: Bad Request before my HttpModule gets hit? Is there something else I can hook into to be able to log the request?

Edit:
I'm starting to think I need some kind of ISAPI filter or extension. Not knowing anything about this, some help going this direction would be appreciated if this is the appropriate course of action.

Was it helpful?

Solution

Per this article, some errors will never reach the application error handling code. "Some errors that occur in an HTTP-based application are automatically handled by the HTTP API instead of being passed back to an application for handling. This behavior occurs because the frequency of such errors might otherwise flood an event log or an application handler."

Examples of such errors: 400, some 500, 503, connection timeouts etc.

They seem only to be available in the HTTP.sys "httperr#.log" files; the same article describes the location and format of these log files.

See also: How to troubleshoot HTTP 400 errors

OTHER TIPS

It should not be hitting the actual page but IIS will still log the attempt in the log.

The exact location of the log files differ and can be seen in the IIS Manager. Usually the IIS log is in C:\WINDOWS\system32\LogFiles\W3SVC1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top