关于Web服务的问题,大侠帮帮忙解释一下!谢谢
关于Web服务的问题,大侠帮帮忙解释一下!谢谢
我写了一个简单的Web服务,但是以HTTP-Get方式访问不了( System.InvalidOperationException: 请求格式无法识别):
http://localhost/FirstService/FirstService.asmx/Hello?name=cdh
但是http://localhost/FirstService/FirstService.asmx用他测试是正确的
是什么问题
代码在下面:(FirstService.asmx)只有这一页,呵呵
<%@ WebService Language="C#" Class="FirstService" Debug="true" %>
using System.Web.Services;
public class FirstService:WebService
{
[WebMethod]
public string Hello(string name)
{
if(name=="")
return "Hello World";
return "Hello "+name;
}
}
环境:FrameWork1.1