将连接复位(502)在IIS 7.5接触WCF服务时, [英] Connection reset by peer (502) when contacting WCF service in IIS 7.5

查看:266
本文介绍了将连接复位(502)在IIS 7.5接触WCF服务时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有已经工作正常了几个月的WCF服务。就在今天上午,调用该服务开始与代理服务器报告通过对等连接复位(502)失败。奇怪的是有对丢弃的连接没有IIS日志记录,虽然我们能够使用Wireshark探测到它们。因此看来,如果线程正在死去,不留痕迹。

We have a WCF service that has been working fine for months. Just this morning, calls to this service began failing with the proxy server reporting "connection reset by peer" (502). Oddly enough there are no IIS log entries for the dropped connections, although we are able to detect them with WireShark. So it seems as if the thread is dying, leaving no trace behind.

该问题的Web方法检索100个数据库记录。我们发现,通过限制结果,以20条记录它按预期工作。我怀疑有来发挥超时,但没有异常,或回溯这是很难知道的。

The problematic web method was retrieving 100 database records. We found that by restricting the results to 20 records it works as expected. I suspect there is a timeout coming into play, but with no exception or traceback it's very hard to know.

有没有人遇到过这个?关于如何解决它有什么建议?

Has anyone experienced this? Any suggestions on how to troubleshoot it?

推荐答案

您可以打开WCF诊断你的服务,以获取有关异常的更多详细信息。

You can turn on WCF diagnostics on your service to get more details about exceptions.

让你去迅速 - 在您的网页(或应用)的配置:

To get you going quickly - in your web (or app) config:

1)任意位置添加System.Diagnostics程序部分的配置元素。您可以替换与以往的路径你想要的文件存储在路径。

1) Add System.Diagnostics section anywhere under configuration element. You can replace path with which ever path you want the files to be stored at.

<system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelMessageLoggingListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
      <source name="System.ServiceModel" switchValue="Warning, ActivityTracing" propagateActivity="true">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelTraceListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="C:\temp\services_messages.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelMessageLoggingListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
        <filter type="" />
      </add>
      <add initializeData="C:\temp\services_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>

2)在system.ServiceModel添加以下内容:

2) Under system.ServiceModel add following:

<diagnostics wmiProviderEnabled="false">
      <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
    </diagnostics>

3)在C:\\ Program Files文件(x86)的\\微软的SDK \\ WINDOWS \\ v7.0A \\ BIN \\启动SvcTraceViewer.exe。同时加载邮件跟踪(services_messages.svclog)和服务跟踪日志(services_tracelog.svclog)。您可以拖放在工具或开放的文件,然后添加其他

3) Under C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ start SvcTraceViewer.exe. Load both message trace (services_messages.svclog) and service trace log (services_tracelog.svclog). You can either drag drop files in the tool or open one then add another

4)寻找一个问题的红色粗体字。

4) Look for red bold letters for a problem.

如果你想使你的经验编辑WCF配置更可口,你可以使用SvcConfigEditor.exe这是同一个文件夹下找到作为SvcTraceViewer.exe(#3)。只需打开配置文件,你会看到诊断文件夹,让您启动/停止和配置的诊断。

If you want to make your experience editing the WCF configuration more palatable you can use SvcConfigEditor.exe which is found under same folder as SvcTraceViewer.exe (#3). Just open the config file and you should see Diagnostics folder which will allow you to start/stop and configure diagnostics.

这篇关于将连接复位(502)在IIS 7.5接触WCF服务时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆