none
WCF 异常超时,求指教 RRS feed

  • 问题

  • WCF 挂在WindowsService上,此服务大概需要11分钟左右,现在我发现只要运行超过10分钟以上,就会报错(却不是报的timeout错误)

    错误信息如下:

    接收对 http://nb1212009:9999/ADHelper 的 HTTP 响应时发生错误。这可能是由于服务终结点绑定未使用 HTTP 协议造成的。这还可能是由于服务器中止了 HTTP 请求上下文(可能由于服务关闭)所致。有关详细信息,请参见服务器日志。

    我已经设置了超时 20分钟 ②设置inactivetimeout 30分钟 ③线程数设置为20

    还是报这个错,真心不知道问题出在哪了,求大神指教!谢谢!!!

    Service配置:

     
      <system.web>
        <compilation debug="true" />
      </system.web>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ADHelperBehavior">
              <serviceThrottling maxConcurrentCalls="20" maxConcurrentSessions="20" maxConcurrentInstances="30" />
              <serviceMetadata httpGetEnabled="true"  />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="Diodes.BPMService.ADHelper"  behaviorConfiguration="ADHelperBehavior">
            <endpoint address="" contract="Diodes.BPMService.BPMInterface.IADHelper" binding="wsHttpBinding"  />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://nb1212009:9999/ADHelper" />
              </baseAddresses>
            </host>
          </service>
        </services>
        <bindings>
          <wsHttpBinding>
            <binding name="WSHttpBinding_IADHelper" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
              bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288000" maxReceivedMessageSize="65536000"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <reliableSession ordered="true" inactivityTimeout="00:30:00" enabled="true" />
              <readerQuotas maxStringContentLength="20971520" maxArrayLength="20971520"/>
              <security mode="None" />
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>

    Client配置:

    <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding name="WSHttpBinding_IADHelper" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
              bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288000" maxReceivedMessageSize="65536000"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:30:00"
                enabled="false" />
              <security mode="Message">
                <transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://nb1212009:9999/ADHelper" binding="wsHttpBinding"
            bindingConfiguration="WSHttpBinding_IADHelper" contract="wcfADService.IADHelper"
            name="WSHttpBinding_IADHelper">
            <identity>
              <servicePrincipalName value="host/NB1212009.sh.XXX.com" />
            </identity>
          </endpoint>
        </client>
      </system.serviceModel>

    2014年1月16日 5:40

答案

全部回复