Webexception first time

S

srini

I have a console application in C#, which calls a .net webservice.
The .net webservice calls a stored procedure to retrieve the data.
The sp runs for around 3 minutes and get the results. The first time, I
get the exception
and the next time I understand it is in the buffer cache and it is able
to run without error.

I have made the following changes so far
1. Changed web.config in the webservice to have the http execution time
out to be high
<httpRuntime maxRequestLength="1048576" executionTimeout="4000"/>
2. I have the console application which is the caller to have
webservice.timeout = 60*1000;
3.I did not want to change the machine.config, as it will effect all
other projects.

I get the following webexception still after implement 1 and 2 ( A
WebException occurred while executing the requested operation.
Message: The operation has timed-out.)
Is there anything I am missing other than machine.config ?

Thanks
 
M

Morten Wennevik

Hi Srini,

I'm guessing your web service call times out. The default is 100 000
milliseconds before it gives up waiting.
Set the Timeout property before you call the service.
 
S

srini

Morten
I thought thats what I am doing in the console application. I changed
from 60000
to 100000 and it still fails. would you mind reading the problem again
?

thanks
 
S

srini

Never mind, just realized we are dealing with milliseconds. It works
now after changing to 300 seconds.
 

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

Top