c# - HTTPERR 日志 : Request_Cancelled (while troubleshooting WCF service)

标签 c# wcf http http.sys

我正在尝试对访问 WCF 自承载服务的 WCF 客户端上的“连接被远程主机强行关闭”错误进行故障排除。我在服务端机器上查看 System32\LogFiles\HTTPERR 中的 httperr 日志,每次在我的客户端上看到该错误时,我都会在日志中看到带有我的服务端点 URI 的条目。原因是“Request_Cancelled”。

我在任何地方都找不到关于这个原因意味着什么的任何信息。我可以猜到,但我想确定地知道,因为它一定与我在客户端中看到的错误有某种关系。

HTTPERR 日志中的“Request_Cancelled”是什么?作为奖励,您能否进一步说明我的 WCF 问题?

最佳答案

Request_cancelled 可能超时。

默认应该是

OpenTimeout - 1 minute
CloseTimeout - 1 minute
SendTimeOut - 1 minute
ReceiveTimeout - 10 minute.

尝试在您的 web.config 中设置这些设置。 它将向您的 Web 服务添加更多日志记录。

在您的 system.serviceModel 部分

<system.serviceModel>

....

    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000" />
    </diagnostics>     

....
</system.serviceModel>

并添加 system.diagnostics 部分。它会将日志保存到 c:\temp\wcfServiceLog.svc

<system.diagnostics>
    <switches>
      <add name="XmlSerialization.Compilation" value="4"/>
  </switches>
   <sources>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
        <listeners>
          <add name="xml" />
        </listeners>
      </source>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="xml" />
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\temp\wcfServiceLog.svc" />
    </sharedListeners>
  </system.diagnostics>

关于c# - HTTPERR 日志 : Request_Cancelled (while troubleshooting WCF service),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27725258/

相关文章:

http - 如何在一天内存储服务器上的请求数?

java - 消息新鲜度和有效性 JAVA PHP mysql

c# - Ajax 计时器在处理另一个请求时不轮询

c# - 无法加载文件或程序集 system.memory 版本 4.1.0.0

c# - C#中的抽象方法

C# 如何在 WCF 应用程序的业务逻辑类中的两个方法之间实现标志消息传递系统?

c# - 为什么我需要 WCF 来构建 RESTful 服务?

c# - "Nested foreach"与 "lambda/linq query"性能(LINQ 到对象)

.net - 托管 WCF 服务时出错

python - 如何将每个文件的自定义 header 添加到带有请求的分段上传?