且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是ASP.NET web服务请求生命周期?

更新时间:2022-11-06 12:08:37

是 - Otavio是正确的,没有页面事件ASMX Web服务,因为他们没有从页面派生

Yes - Otavio is correct, there is no Page events for ASMX Web Services, as they do not derive from Page.

不过,请求遵循常规 ASP.NET处理管道

有在有关的IHttpHandler被执行的处理的一个点。这可以是一个页面,一个通用的HTTP处理程序,或web服务。

There is a point in the process where the relevant IHttpHandler is executed. This can be a page, a generic HTTP handler, or a web service.

这就是Web服务请求的执行情况。

This is where the web service request execution happens.

所以,这真的取决于你想在这里做什么。该构造函数应该提供一个良好的钩到pre-请求执行。如果你正在寻找的东西甚至更早,那么你可能需要挂接到一个Global.asax中的事件。

So, it really depends on what you're trying to do here. The ctor should provide a good hook-in to pre-request execution. If you're looking for something even earlier, then you will likely need to hook into a Global.asax event.