HTTPERR log: Request_Cancelled (while troubleshooting WCF service)

天大地大妈咪最大 提交于 2019-12-21 22:27:54

问题


I am trying to troubleshoot a "connection was forcibly closed by the remote host" error on a WCF client accessing a WCF self-hosted service. I was looking at the httperr logs in System32\LogFiles\HTTPERR on the service-side machine and each time I see that error on my client, I see entries in the log with my service's endpoint URI. The reason is "Request_Cancelled".

I can't find anything anywhere about what that reason signifies. I can guess, but I'd like to know for sure, as it must have some relation to the errors I am seeing in my client.

What is "Request_Cancelled" in the HTTPERR log? And as a bonus, can you shed any extra light on my WCF issues?


回答1:


Request_cancelled might be a timeout.

By default it should be

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

Try set these settings in your web.config. It will add further logging to your web service.

At your system.serviceModel section

<system.serviceModel>

....

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

....
</system.serviceModel>

and add system.diagnostics section. It will save a log to 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>


来源:https://stackoverflow.com/questions/27725258/httperr-log-request-cancelled-while-troubleshooting-wcf-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!