开发者

When might Application_EndRequest not be called?

We have an ASMX web service hosted in IIS 6, and are seeing some strange behaviour with one of our WebMethods. After an iisreset, the first call to a particular method fails to return to the client, which times out after 60 seconds.

I've introduced logging into Application_BeginRequest and Application_EndRequest in the Global.asax.cs file. The logging shows that for that one cal开发者_StackOverflow社区l, EndRequest is not called. A try-finally block in the method itself shows that it is running to completion.

There are other requests to different methods before, during and after this one that show no problems. TcpTrace shows that no reply is ever returned for that first request to the method.

The logs also show that the thread that serviced the request starts serving other requests after the finally block has completed.

I'm wondering what might cause such behaviour, and how I might debug this further.


Assuming this is entirely repeatable, I would start by changing the method. Namely I would remove stuff until it works as expected.

It sounds like there is some odd secondary behavior caused by the web method itself. I'm guessing it's a bit more complex than just adding two numbers together and returning a result.

Also I'd pay close attention to what the method is doing. For example, is it instantiating unmanaged resources? Do you have any http handlers or modules involved which might be cratering on the first execution for this method?

By eliminating code until it works you'll figure out exactly what's causing this.


some recommendations: put your logging under: Application_AuthenticateRequest Application_Error and see if you are getting any error.

If this cannot help, check your Application Domain's and IIS's event logs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜