提高超时为单个Web服务 [英] Raise the time-out for a single webservice

查看:128
本文介绍了提高超时为单个Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网路设定如下:

<system.web>
    <compilation debug="false"/>
    <httpRuntime executionTimeout="90"/>
</system.web>

这对于大多数webservice函数来说都很好,但是一个函数有一个运行很长的查询分钟)的时间,并将在它完成之前停止。是否可以单独为这个webservice设置运行时间为5分钟?

This is fine for most webservice functions but one function has a query that is running a very long (5 minutes) time and will be stopped before it has finished. Is it possible to set the runtime to 5 minutes for this webservice alone?

例如:

  MyWebServices.asmx?op=WS_LongMethod --> Timeout of 5 minutes

我想过运行数据库查询异步(火和忘记)使用sybase / oracle通过ODBC似乎不可能。

I've thought about running the database query async (fire and forget) but it doesn't seem possible with sybase/oracle through ODBC.

推荐答案

是的,你可以这样做。在web.config中,您需要添加< location /> 元素:

Yes, you can do that. In the web.config, you'll need to add a <location/> element:

<location path="Path_To_Your_Service.asmx">
    <system.web>
        <httpRuntime executionTimeout="90"/>
    </system.web>
</location>

< location /> 元为您提供一种机制,您可以将web.config属性应用于您网站中的特定路径。

The <location/> element gives you a mechanism whereby you can apply web.config attributes to specific paths within your site.

这篇关于提高超时为单个Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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