gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 17:08:58 31 4
gpt4 key购买 nike

我正在尝试对访问 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/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com