如何修复“无法识别 URL 的请求格式..."?在 IIS 中运行的 Web 服务中出现错误? [英] How do I fix a "Request format is unrecognized for URL..." error in a web service running in IIS?

查看:27
本文介绍了如何修复“无法识别 URL 的请求格式..."?在 IIS 中运行的 Web 服务中出现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 IIS 中运行 Web 服务时出现以下错误:

<块引用>

/收件箱服务"中的服务器错误应用.请求格式为意外无法识别 URL以/GetMailsInfo"结尾.描述:未处理的异常在执行过程中发生当前网络请求.请查看有关更多信息的堆栈跟踪错误及其起源代码.

异常详情:System.InvalidOperationException:无法识别 URL 的请求格式出乎意料地结束'/GetMailsInfo'.

源错误:

产生了未处理的异常在当前的执行过程中网络请求.有关的信息异常的起源和位置可以使用异常来识别下面的堆栈跟踪.

堆栈跟踪:

[无效操作异常:请求无法识别 URL 的格式出乎意料地结束'/GetMailsInfo'.]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(类型类型,HttpContext 上下文,HttpRequest请求,HttpResponse 响应)+490982 System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext上下文,字符串动词,字符串 url,字符串文件路径) +104
System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext上下文,字符串请求类型,字符串url, 字符串路径翻译) +127
System.Web.HttpApplication.MapHttpHandler(HttpContext上下文,字符串请求类型,VirtualPath 路径,字符串pathTranslated, Boolean useAppConfig)+175 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+120 System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔&同步完成)+155

版本信息:Microsoft .NET框架版本:2.0.50727.42;ASP.NET 版本:2.0.50727.42

有谁知道我为什么会看到这个错误,以及是否有办法修复它?

解决方案

由于 HTTP GET 和 HTTP POST 是 默认禁用 尝试将以下内容添加到您的配置文件中:

<预><代码><配置><system.web><网络服务><协议><add name="HttpGet"/><add name="HttpPost"/></协议></webServices></system.web></配置>

I am get the following error while running web service in IIS:

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, String requestType, 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

Does anyone know why I am seeing this error and if there is any way to fix it?

解决方案

Since HTTP GET and HTTP POST are disabled by default try adding the following to your config file:

<configuration>
    <system.web>
    <webServices>
        <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
        </protocols>
    </webServices>
    </system.web>
</configuration>

这篇关于如何修复“无法识别 URL 的请求格式..."?在 IIS 中运行的 Web 服务中出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆