How to set timeout for WebService?

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I would like to know how to set the timeout for
System.Web.Services.WebService class (from which my web service is derived)?
According to documentation there should be Timeout property, but I can not
find this property.

Best regard

Simon
 
<httpRuntime executionTimeout="numberof seconds"/>

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



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espanol : http://asp.net.do/foros/
======================================
 
Which timeout are you looking for?
There are 2 actually.

One on a server which makes sure that your WebService method is not running
forever and will be aborted if exceeds some time.
I do not see Timeout property in WebService class.
http://msdn.microsoft.com/en-us/library/system.web.services.webservice_members.aspx
You can set/change this time out in web.config See: <httpRuntime
executionTimeout="..."/>


Another one is on a client which makes sure that your client is not waiting
forever for WebService to reply...
The class is actually called SoapHttpClientProtocol and it has a Timeout
property.

George.
 
Obviously it must be set on a clients.
Right after you have instantiated your service but before the actual call.

Something like this
Service.StoreSupport sw = new Service.StoreSupport();
sw.Timeout = 1000; //1 second
Service.clsGetCategoriesGroupsReply rp =
sw.GetCategoryGroups(_objBs._sAccessTocken);


George
 
Back
Top