我有一个名为Service1.cs的C#文件,其中包含以下内容:
public class Service1 : System.Web.Services.WebService
{
[System.Web.Services.WebMethod]
public static String testMethod()
{
return "Hello";
}
}
我将这段代码放在helloworld.html文件中:
<WebService Language="c#" Codebehind="Service1.cs"
Class="Service1.Service1">
我的目录位于http://localhost:8000/,其中包含指向helloworld.html的链接以及下载Service1.cs的链接
我必须访问哪个url才能访问testMethod()返回的字符串?
我试过http://localhost:8000/helloworld/testmethod,http://localhost:8000/helloworld/Service1/testmethod, 但我无法弄清楚如何获取从Web服务返回的字符串值。
提前致谢。