1、引用命名空间:
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
2、添加方法标识
[WebMethod]
[SoapRpcMethod(Use = SoapBindingUse.Literal, Action = "http://tempuri.org/MethodName", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/")]
public string MethodName(string param){
....
}