c# - WebService 中间件,如 MVC 中的 ActionFilter
问题描述
我将 ASMX WebService 声明为
[ WebService
(
Namespace = "http://www.namespaceuri.com/WebService/ws",
Description = "The Web Service Description."
)
]
public class WebService: System.Web.Services.WebService
{
[WebMethod]
public string WebServiceMethod(){}
我想在 web 服务方法执行之前和 web 服务方法执行之后拦截上下文。
MVC 有很好的机制IActionFilter
,在 WCF 中是IOperationInvoker
,那么我应该在 asmx 服务中使用什么?
解决方案
推荐阅读
- java - 什么时候初始化静态字段?
- android - 如何在使用导航组件从应用程序注销时退出应用程序?
- vb.net - VB.Net中的倒数
- windows - 是否有任何解决方案可以使用带有 Flutter 桌面的笔记本电脑相机拍照?
- java - 在基于导航的应用程序中存储复杂数据的位置
- node.js - 如何解决 pg-promise 中的 QueryResultError
- c++11 - WebRTC 在 webrtc::PeerConnectionInterface::RTCConfiguration 配置行崩溃;用于本机 Linux 应用程序
- samesite - 是否需要升级 MVC Web 应用程序才能在新版本的 Crome 浏览器中支持 SameSite cookie
- c# - 在字符串中检测和链接 instagram
- visual-studio-2008 - 由于 WM_CLOSE 消息,应用程序意外关闭