简体   繁体   English

增加ASMX Web服务的超时

[英]Increasing timeout of ASMX webservices

I am running an ASMX webservice on IIS 7. The client is a silverlight application. 我在IIS 7上运行ASMX Web服务。客户端是Silverlight应用程序。 I am issuing several asynchronous file requests to the webservice and processing them on AsyncCompleted. 我正在向Web服务发出几个异步文件请求,并在AsyncCompleted上处理它们。 Sometime after all the async requests have been issued, I get the following timeout message. 在所有异步请求发出之后的某个时间,我收到以下超时消息。 How can the timeout be increased. 如何增加超时时间。

I tried adding the following in the web.config of the ASP.NET project that is hosting my silverlight application. 我尝试在托管Silverlight应用程序的ASP.NET项目的web.config中添加以下内容。

<httpRuntime executionTimeout="12000"/>

(This timeout is not happening when I do the requests synchronously, but synchronous operations are very slow.) (当我同步执行请求时,不会发生超时,但是同步操作非常慢。)

The HTTP request to 'http://localhost:5080/Service1.asmx' has exceeded the
allotted timeout. 

Because this is the silverlight application i am in a doubt if my suggestion will work. 因为这是Silverlight应用程序,所以我不确定我的建议是否会起作用。 Just try, to create the object of the webservice and then increase the time out value to what ever seconds you want. 尝试创建Web服务的对象,然后将超时值增加到所需的秒数。 Below code may be helpful 下面的代码可能会有所帮助

 ConsoleApplicationFor2Groups.AdServices.ADService adser = new ADService();
 adser.Timeout = 100000; // this time is in milliseconds

Just let me know if this works. 请让我知道是否可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM