3

我想我会尝试看看是否有人看过这个或类似的东西,因为我不确定从哪里开始寻找。我有一堆网络服务在很长一段时间内都很好,但现在我的服务器人员说他们给出了一个我以前从未见过的错误。有什么想法/事情要看吗?

Log Name:      Application
Source:        ASP.NET 4.0.30319.0
Date:          6/12/2012 6:57:03 AM
Event ID:      1309
Task Category: Web Event
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      Server
Description:
Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 6/12/2012 6:57:03 AM 
Event time (UTC): 6/12/2012 1:57:03 PM 
Event ID: 691c9c8fabeb4701aa31488d6db060ce 
Event sequence: 123578 
Event occurrence: 1 
Event detail code: 0 

Application information: 
Application domain: domain
Trust level: Full 
Application Virtual Path: / 
Application Path: D:\Sites\webroot\ 
Machine name: Server

Process information: 
Process ID: 2456 
Process name: w3wp.exe 
Account name: IIS APPPOOL\AppPool_AID1651 

Exception information: 
Exception type: InvalidOperationException 
Exception message: Request format is unrecognized for URL unexpectedly ending in '/$metadata'.
at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

谢谢!

4

2 回答 2

1

您只需将以下内容添加到您的 web.config

<configuration>
  <system.web>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>
  </system.web>
</configuration>
于 2020-04-22T18:17:42.227 回答
-1

我的网络服务也记录Event Code 3005. 我正在使用 JQuery 调用我的 Web 服务$.ajax(),它会产生两个 http 请求。第一个请求是“OPTIONS”请求,并收到500 Internal Server Error一条消息。这是正在记录的那个Event Code 3005。第二个请求是“POST”请求,Web 服务给出了正确的答案。

我没有成功阻止“选项”请求被记录为错误,但我希望这些信息对你有帮助。

我的错误日志也与你的这个短语相匹配:

异常消息:无法识别请求格式,因为 URL 意外以…结尾。</p>

于 2012-08-17T18:13:53.713 回答