女真不可过万,后金:通过httt访问web service的问题!

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 23:29:04
一个web service的asmx文件如何通过http访问啊?
文件名:webservice.asmx,类中方法名add,两个参数a,b,求和.
我用:
http://localhost/webservice.asmx/add?a=4&b=5

应该返回9,可提示:

-----------------------------------------------------
“/WebService”应用程序中的服务器错误。
--------------------------------------------------------------------------------

请求格式无法识别。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: 请求格式无法识别。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:

[InvalidOperationException: 请求格式无法识别。]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +388
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +94
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, String path, String pathTranslated, Boolean useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +95
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173

--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573

web service中使用了不支持的数据类型?