c#中webservice函数如何实现重载

来源:互联网 发布:雅安电视台网络直播 编辑:程序博客网 时间:2024/05/21 07:02

c#中webservice函数如何实现重载

在webservice中增加以下代码,一定要加在类的外面。
[WebServiceBinding(ConformsTo = WsiProfiles.None)]

然后函数是按如下方式写:增加MessageName项
 [WebMethod]
    public bool User_Login(string sUserId,string sHardId,string sSJ,out string ErrorMsg)
    {
         return true;
 }

  [WebMethod(MessageName = "method2")]
    public bool User_Login(string sUserId, string sHardId, string sSJ, string sPOS_Version,out string ErrorMsg)
    {
     return true;
 }

  [WebMethod(MessageName = "method3")]
    public bool User_Login(string sUserId, string sHardId, string sSJ, string sPOS_Version,string p3,out string ErrorMsg)
    {
       return true;
    }

阅读全文
0 0