如何在服务器端获取被调用webservice.asmx的方法名称

How to get method name of called webservice.asmx on the server side

我在客户端从我的 Web 服务调用我的一些 WebMethod。它是 .NET webservice.asmx。然后,当我首先在服务器端处理此请求时,它会转到 AuthModule:IHttpModule。我需要有关方法名称的信息。

我需要在服务器端获取有关调用的 webservice 方法的名称的信息。

HttpContext.Current.Request.Url.AbsolutePath;

returns .../serviceName 但我需要识别调用了哪个方法。有什么想法吗?

如果您使用的是 SOAP,试试这个:

HttpContext.Current.Request.Headers["SoapAction"]