How to set timeout for WebService?

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
 
J

Juan T. Llibre

<httpRuntime executionTimeout="numberof seconds"/>

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

George

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.
 
G

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top