c#中webservice函数如何实现重载
在webservice中增加以下代码,一定要加在类的外面。
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
然后函数是按如下方式写:增加MessageName项
[WebMethod]
public bool User_Login(string sUserId,string sHardId,string sSJ,out string ErrorMsg)
{
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)
{
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)
{
public bool User_Login(string sUserId, string sHardId, string sSJ, string sPOS_Version,string p3,out string ErrorMsg)
{
return true;
}