WebService SendTimeout 超时问题

System.TimeoutException: 请求通道在等待 00:01:00 以后答复时超时。增加传递给请求调用的超时值,或者增加绑定上的 SendTimeout 值。分配给此操作的时间可能是更长超时的一部分。

 

 

 

 

WCF中解决方案:
1)首先保证客户端每次建立的连接在使用完成后进行关闭.即调用Close()方法,否则此连接会在设置的会话(一般为10分钟)后才自动关闭.期间任何客户端也无法使用此服务.
2)如果默认的连接数不能满足客户端的需要,可以增加连接数.配置文件如下:
<serviceThrottling maxConcurrentCalls="20" maxConcurrentSessions="20" maxConcurrentInstances="30" />
说明:maxConcurrentCalls :最大并发数,默认为16 
maxConcurrentSessions :最大的会话数,主要针对于PerSession的情况,默认为10 
maxConcurrentInstances:最大实例数,默认为26

 

在.net webService 中:

设置这些参数,延长连接时间,

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

  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>  

转载于:https://www.cnblogs.com/wsh-zc/p/4798016.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值