[System.Web.Services.Protocols.SoapDocumentMethodAttribute(... ...)] [return: System.Xml.Serialization.XmlElementAttribute("GetDataProviderResult")] public int GetDataProvider() { object[] results = this.Invoke("GetDataProvider", new object[0]); return (int)results[0]; }
那么,你只需将该方法的主体部分大概改成这个样子即可:
public int GetDataProvider { [System.Web.Services.Protocols.SoapDocumentMethodAttribute(... ...)] [return: System.Xml.Serialization.XmlElementAttribute("GetDataProviderResult")] get { object[] results = this.Invoke("GetDataProvider", new object[0]); return (int)results[0]; } }