控制台托管的WCF服务意外终止,没有任何tracelog

时间:2014-02-13 06:30:35

标签: c# asp.net wcf wcf-binding

我有三个项目cobol(后端)和wcf服务(communicator)和asp.net web应用程序(客户端)。

我使用Windows服务在控制台应用程序中托管了wcf服务。当客户端发送请求时,它将通过服务传递到后端,并通过服务从后端到客户端的响应 问题来了:

如果在处理请求期间后端(cobol)发生某些错误,则托管在控制台中的wcf服务会突然终止而不会有任何跟踪。但是客户有一个例外:

  

an error occured while recieving the http response to http://localhost:8081/testclient. this could be due to the service endpoint binding not using the http protocol.this could also be due to an http request context being aborted by the server(possibly due to the service shutting down ).see server logs for more details

当我检查主机的跟踪日志时,会有日志,直到后端处理,但没有关于主机控制台终止的详细信息

这是我的客户端`

的app.config
<basicHttpBinding>
        <binding name="BasicHttpBinding_Itestclient" openTimeout="00:05:00" receiveTimeout="00:05:00" sendTimeout="00:05:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" messageEncoding="Text">
          <readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
</basicHttpBinding>
<client>
      <endpoint address="http://localhost:8081/testclient" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_Itestclient" contract="SvcReftestclient.Itestclient"
        name="BasicHttpBinding_Itestclient" />
</client>

`

也增加了maxReceivedMessageSize但没有用,

这是我的主机跟踪日志配置

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "D:\testclient\Trace\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

如何在跟踪中捕获此类错误?如何防止主机控制台在这种情况下终止?

0 个答案:

没有答案