[code=HTML][/code]
- C# code
[System.Web.Services.WebServiceBindingAttribute(Name = "HelloWorld", Namespace = "http://tempuri.org/")]public partial class Soap : System.Web.Services.Protocols.SoapHttpClientProtocol{ public Soap() { this.Url = "http://localhost/webservice.asmx"; } public DateTime GetDate() { object[] results = this.Invoke("HelloWorld", new object[] { }); return ((DateTime)(results[1])); }}
我用这个获取数据的时候出错
- HTML code
异常详细信息: System.ArgumentException: HelloWorld Web 服务方法名无效。源错误: 行 65: public DateTime GetDate()行 66: {行 67: object[] results = this.Invoke("HelloWorld", new object[] { });行 68: return ((DateTime)(results[1]));行 69: }
是什么问题
HelloWorld是有的啊
在webservice.asmx中测试没有问题
请教了
------解决方案--------------------
HelloWorld应该是个方法