ASMX Web 服务超时增加

问题描述 投票:0回答:3

我正在 IIS 7 上运行 ASMX Web 服务。客户端是 silverlight 应用程序。我向 Web 服务发出几个异步文件请求,并在 AsyncCompleted 上处理它们。在发出所有异步请求后的某个时间,我收到以下超时消息。如何增加超时时间。

我尝试在托管我的 silverlight 应用程序的 ASP.NET 项目的 web.config 中添加以下内容。

<httpRuntime executionTimeout="12000"/>

(当我同步执行请求时,不会发生此超时,但同步操作非常慢。)

The HTTP request to 'http://localhost:5080/Service1.asmx' has exceeded the
allotted timeout. 
c# silverlight web-services asmx
3个回答

0
投票

因为这是 silverlight 应用程序,我怀疑我的建议是否有效。 只需尝试创建 Web 服务的对象,然后将超时值增加到您想要的秒数。 下面的代码可能会有所帮助

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

请告诉我这是否有效。


0
投票

就我而言,我有一个 VB.NET 桌面应用程序,其中配置了 asmx 服务。超时错误来自某些国家,有时来自某些 ISP。

问题是我在 asmx 请求中使用了 http 特定的 URL。当我将asmx服务引用的URL中的http更改为https时,问题解决了。

© www.soinside.com 2019 - 2024. All rights reserved.