2012-07-13 52 views
0

的時候如果我送這將導致大量的數據被拉到我收到以下錯誤參數拋出一個超時錯誤:WCF服務使用WcfTestClient

請求信道超時,而00後等待答覆: 01:00。增加傳遞給請求調用的超時值或增加綁定上的SendTimeout值。分配給此操作的時間可能是超時時間的一部分。

我增加了所有的超時時間。客戶端有什麼我需要做的嗎?我想知道是否因爲我使用wcftestclient?我是否需要調整operationTimeout?

我的webconfig有以下幾點:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="Basic" sendTimeout="12:00:00" receiveTimeout="12:00:00" openTimeout="00:10:00" closeTimeout="00:10:00" 
       maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"> 
      <readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="8192"/>   
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="CaseStudyBehavior" name="EDTFS.ADMS.CaseStudyService">   
     <endpoint address="" 
        binding="basicHttpBinding" 
        bindingConfiguration="Basic"      
        name="Basic"      
        contract="EDTFS.ADMS.ICaseStudyService" /> 
     <endpoint address="mex" 
        binding="mexHttpBinding" 
        name="Metadata" 
        contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="CaseStudyBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
      <serviceTimeouts transactionTimeout="24:00:00"/> 
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
+0

顯示您的方法 – 2012-07-13 19:09:11

回答

4

在WCF測試客戶端,你會發現一個名爲Config File服務之下節點。用鼠標右鍵單擊並選擇Edit with SvcConfigEditor增加客戶端上的超時。

+0

這種方法可行,但我必須每次都在本地運行我的服務。有沒有辦法讓它永久保留? – hyprsleepy 2012-07-16 16:20:49

+0

在WCF Test Client菜單中選擇_Tools_ - > _Options ..._,並取消選中_Always在啓動服務_時重新生成配置。 – Martin4ndersen 2012-07-16 19:52:39