Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raise the time-out for a single webservice

My web configuration looks as follows:

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

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?

E.g.:

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

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

like image 732
Carra Avatar asked Dec 13 '22 23:12

Carra


1 Answers

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>

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

like image 96
Richard Avatar answered Dec 15 '22 12:12

Richard