WebService SendTimeout 超時問題

System.TimeoutException: 請求通道在等待 00:01:00 之後答覆時超時。增長傳遞給請求調用的超時值,或者增長綁定上的 SendTimeout 值。分配給此操做的時間多是更長超時的一部分。web

 

 

 

 

WCF中解決方案:
1)首先保證客戶端每次創建的鏈接在使用完成後進行關閉.即調用Close()方法,不然此鏈接會在設置的會話(通常爲10分鐘)後才自動關閉.期間任何客戶端也沒法使用此服務.
2)若是默認的鏈接數不能知足客戶端的須要,能夠增長鏈接數.配置文件以下:
<serviceThrottling maxConcurrentCalls="20" maxConcurrentSessions="20" maxConcurrentInstances="30" />
說明:maxConcurrentCalls :最大併發數,默認爲16 
maxConcurrentSessions :最大的會話數,主要針對於PerSession的狀況,默認爲10 
maxConcurrentInstances:最大實例數,默認爲26併發

 

在.net webService 中:ui

設置這些參數,延長鏈接時間,spa

closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"  .net

  1. <system.serviceModel>  
  2.    <bindings>  
  3.      <basicHttpBinding>  
  4.        <binding name="fuyiDataSoap" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false"  
  5.            bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"  maxBufferSize="2147483646" maxBufferPoolSize="2147483646"  
  6.            maxReceivedMessageSize="2147483646" messageEncoding="Text"   textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">  
  7.          <readerQuotas maxDepth="32" maxStringContentLength="2147483646"    maxArrayLength="2147483646" maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" />  
  8.          <security mode="None">  
  9.            <transport clientCredentialType="None" proxyCredentialType="None"  realm="" />  
  10.            <message clientCredentialType="UserName" algorithmSuite="Default" />  
  11.          </security>  
  12.        </binding>  
  13.      </basicHttpBinding>  
  14.    </bindings>  
  15.    <behaviors>  
  16.      <endpointBehaviors>  
  17.        <behavior name="RestfulEndpointBehavior">  
  18.          <dataContractSerializer maxItemsInObjectGraph="2147483647" />  
  19.        </behavior>  
  20.      </endpointBehaviors>  
  21.    </behaviors>  
  22.   <client>  
  23.    <endpoint address="http://121.101.215.59/FuyiZXDataService/fuyiData.asmx" binding="basicHttpBinding" bindingConfiguration="fuyiDataSoap"    contract="FuyiZXDataService.fuyiDataSoap" name="fuyiDataSoap" />  
  24.   </client>  
  25.        
  26.  </system.serviceModel>  
相關文章
相關標籤/搜索