加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 如何修复在IIS中运行的Web服务中的“请求格式无法识

发布时间:2020-12-15 19:19:50 所属栏目:asp.Net 来源:网络整理
导读:我在IIS中运行Web服务时收到以下错误: Server Error in ‘/Inbox Sevice’ Application. Request format is unrecognized for URL unexpectedly ending in ‘/GetMailsInfo’. Description: An unhandled exception occurred during the execution of the c
我在IIS中运行Web服务时收到以下错误:

Server Error in ‘/Inbox Sevice’
Application. Request format is
unrecognized for URL unexpectedly
ending in ‘/GetMailsInfo’.
Description: An unhandled exception
occurred during the execution of the
current web request. Please review the
stack trace for more information about
the error and where it originated in
the code.

Exception Details:
System.InvalidOperationException:
Request format is unrecognized for URL
unexpectedly ending in
‘/GetMailsInfo’.

Source Error:

An unhandled exception was generated
during the execution of the current
web request. Information regarding the
origin and location of the exception
can be identified using the exception
stack trace below.

Stack Trace:

[InvalidOperationException: Request
format is unrecognized for URL
unexpectedly ending in
‘/GetMailsInfo’.]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type,HttpContext context,HttpRequest
request,HttpResponse response)
+490982 System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext
context,String verb,String url,
String filePath) +104
System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext
context,String requestType,String
url,String pathTranslated) +127
System.Web.HttpApplication.MapHttpHandler(HttpContext
context,
VirtualPath path,String
pathTranslated,Boolean useAppConfig)
+175 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+120 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step,Boolean& completedSynchronously)
+155

Version Information: Microsoft .NET
Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42

有人知道我为什么看到这个错误,如果有任何方法来解决它?

解决方法

由于HTTP GET和HTTP POST是 disabled by default,请尝试将以下内容添加到您的配置文件中:
<configuration>
    <system.web>
    <webServices>
        <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
        </protocols>
    </webServices>
    </system.web>
</configuration>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读