大家好 刚学习webserice怎么用?碰到一个问题, 在vs2008浏览http://localhost:2536/servicTest/myser.asmx/HelloWorld/ HelloWorld 方法可以看到XML页面,
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Hello World</string>
但我发布到自己的iis上 点http://127.0.0.1/ser/myser.asmx/HelloWorld 方法 就页面出现这种错误,怎么解决?
不允许用于访问路径“/ser/myser.asmx/HelloWorld”的 HTTP 谓词 POST。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Web.HttpException: 不允许用于访问路径“/ser/myser.asmx/HelloWorld”的 HTTP 谓词 POST。
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[HttpException (0x80004005): 不允许用于访问路径“/ser/myser.asmx/HelloWorld”的 HTTP 谓词 POST。]
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +3456725
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +369
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161