views:

990

answers:

3

I am making a post from a .NET console app to a .NET web service. I know that the timeout on the server side is 20 min, but if my client takes more than 100 seconds to post my data to that service then I get a timeout exception. How would I tell my client to wait the available 20 min to timeout?

+3  A: 

on the client side, your webservice object has a timeout value. It should be pretty easy to set by going:

myServiceInstance.Timeout = 1200000

for 20 minutes

lomaxx
A: 

Yup the ServiceInstance.Timeout is the property to set.

I blogged about it here http://stackpanel.com/blog/2008/10/client-timeout-accessing-asmx-web-service/

Vin
Blog link Page Not Found (404)
YeahStu
+2  A: 

You need to verify that <httpRuntime executionTimeout="1200"/> exists in the web.config on the webservice itself to confirm your 20 minutes.

The service proxy class instance in your console app also needs to be set. There is a Timeout property to set (in milliseconds) so you would do something like this:

MyServiceClass myService = new MyServiceClass(); myService.Timeout = 1200000;

wulimaster
We need the Gmailish notifications that someone has posted to this question for us people who don't type as fast as the others ;->
wulimaster
+1 for mentioning that you have to do it on the client and on the server.
quillbreaker