如何增加超时到Web服务请求? [英] How to increase the timeout to a web service request?

查看:176
本文介绍了如何增加超时到Web服务请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET Web应用程序,我不能修改(我只有二进制文件)。这个应用程序连接到Web服务,它似乎是连接从客户端(我的web应用程序)关闭。我在目标服务器的machine.config中增加了executionTimeout,但我的web应用程序似乎在等待一段时间后仍然停止。

I have an ASP.NET web application that I can't modify (I only have the binaries). This application connects to a web service and it seems like the connection is closed from the client side (my web app). I have increased the "executionTimeout" in the machine.config of the destination server but my web app seems to still stop after waiting for a while.

有没有通过简单地修改web.config中增加的超时时间我的web应用程序的方法吗?就像我说的...我不能修改code超时,所以我唯一的选择就是通过配置文件。

Is there a way to increase the timeout time for my web application by simply modifying the web.config? As I said... I can't modify the timeout in the code so my only option would be through config files.

谢谢!

推荐答案

试试这是否会为你工作。

Try if this would work for you.

首先,你需要增加的httpRuntime元素的executionTimeout属性的超时时间。请注意,这是在几秒钟提到像不像会话超时和其他人其他超时属性。

Firstly, you need to increase the timeout of the executionTimeout attribute of the httpRuntime element. Note that this is mentioned in Seconds unlike the other timeout attributes like the Session timeout and others.

<httpRuntime 
    executionTimeout="36000"

而且,这个属性生效,只有当你的编译元素的debug属性设置为false。这也是在你提到的MSDN链接指定。就像,

And moreover, this attribute takes effect only when you set the debug attribute of the Compilation element to false. This is also specified in the MSDN link that you mentioned. Like,

<compilation 
   debug="false" 
../>

但是,这可与会话超时相结合。是的,如果会话超时,那么一个错误就会被抛出。而且它不会等待executionTimeout值生效。所以你还需要会话超时设置为一个较高的值。并注意,这是在分钟。这将是什么样子,

But this works in conjunction with the Session timeout. Yes, if the session times out , then an error would be thrown. and it wouldn't wait for the executionTimeout value to take effect. so you also need to set the Session Timeout to a higher value. And note that this is in minutes. which would look like,

<sessionState 
    mode="InProc" 
    timeout="360"
    ...
    />

和注意,所有这些都是由程序池回收过程中指定。所以你需要设置程序池的空闲超时值,您的网站使用比会话超时ATLEAST相同/更高的价值。

And note that all of this would be overriden by AppPool recycling process. so you need to set the Idle Timeout value of the Apppool that your website uses to atleast same / higher value than the session timeout.

我在这里找到<一个href=\"http://www.eggheadcafe.com/community/aspnet/17/10111748/how-can-we-increase-the-t.aspx\">http://www.eggheadcafe.com/community/aspnet/17/10111748/how-can-we-increase-the-t.aspx

这篇关于如何增加超时到Web服务请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆