什么是Web服务中的Web方法属性?

Tus*_*aru 1 c# asp.net web-services webmethod

什么是Web服务中的Web方法属性?举个例子

[WebMethod(EnableSession = true)]
[ScriptMethod(UseHttpGet = true)]
public string GetApplicationDomains(string strParameterList)
{

}        
Run Code Online (Sandbox Code Playgroud)

为什么使用WebMethod和ScriptMethod这个属性?

Dmy*_*iak 5

WebMethod表示"作为XML Web服务的一部分公开的方法".
ScriptMethod "指定用于调用方法的HTTP谓词,以及响应的格式"