none
wcf 传送大量数据出现基础连接已经关闭错误! RRS feed

  • 问题

  • wcf 服务宿主在IIS 中,当从数据库中检索两万条记录时出现基础连接已经关闭错误,而检索两千条左右的记录时是正常的。 服务器端的配置文件如下:排除maxReceivedMessageSize 设置过小因素。

    开发平台:vs2008; 操作系统windows xp2

     <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding name="NewBinding0" closeTimeout="00:10:00" openTimeout="00:10:00"
              sendTimeout="00:10:00" maxBufferPoolSize="524288000" maxReceivedMessageSize="65536000">
             </binding>
          </wsHttpBinding>
        </bindings>
        <services>
          <service behaviorConfiguration="WcfService.Service1Behavior"
            name="WcfService.Service1">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NewBinding0"
              name="HttpEndpoint" contract="WcfService.IService1">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" name="MexEndpoint"
              contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost/TestProject"/>
              </baseAddresses>
              <timeouts closeTimeout="00:10:10" />
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="WcfService.Service1Behavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>

     

     

    2008年11月13日 9:09

答案