470,815 Members | 1,320 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

The operation has timed out - Error

Hi,

I am calling a web service to get Latitude and Longitude by sending a zip
code. This is happening inside a loop (2000 - 3000 times). After say 80
times, it gives me an error - The operation has timed out. If I continue by
pressing F10, the process starts again and everything is fine. After some
time again it will stop, show me an error on the line where I am calling
webservice and if i say F10, it will again continue.

I wanted to know how can I stop this "The operation has timed out" error
from coming. I have also set the Time Out property of web service to a large
value (1000000 ms), but still it doesn't help. I'm using .Net 2.0

Thanks,
Pooja.
Aug 11 '06 #1
1 3900
Hello Pooja,

I hope the following suggestions would be helpful to you.
Timeout is the property which is related to the synchronous calls to the
webservice methods. No matter how long you set the timeout for method call,
the client may sometimes fail to receive the response in the stipulated time
limits.
I would rather suggest you to call the web method Asynchronously.
Here i assume that you know how to call the methods asynchronous.

Below are some examples.
*****
private void Button1_Click(object sender, EventArgs e)
{
// Synchronous call to webservice method.
Service.Service objService = new
TestInfragistics.Service.Service();
objService.Timeout = 1000000;
MessageBox.Show(objService.HelloWorld().ToString() );
MessageBox.Show(objService.Hello("Smith").ToString ());
objService.Dispose();

// Asynchronous call to webservice method.
Service.Service objService1 = new
TestInfragistics.Service.Service();
objService1.HelloCompleted += new
HelloCompletedEventHandler(objService1_HelloComple ted);
objService1.HelloAsync("Smith");
objService1.Dispose();

// Asynchronous call - 2 to webservice method.
Service.Service objService2 = new
TestInfragistics.Service.Service();
objService2.HelloWorldCompleted += new
HelloWorldCompletedEventHandler(objService2_HelloW orldCompleted);
objService2.HelloWorldAsync();
objService2.Dispose();
}
void objService2_HelloWorldCompleted(object sender,
HelloWorldCompletedEventArgs e)
{
if (e.Result != null)
MessageBox.Show(e.Result.ToString());
}

void objService1_HelloCompleted(object sender,
HelloCompletedEventArgs e)
{
if (e.Result != null)
MessageBox.Show(e.Result.ToString());
}
*****
Hope this would solve your problem.

Jay Kudecha.

"Pooja" wrote:
Hi,

I am calling a web service to get Latitude and Longitude by sending a zip
code. This is happening inside a loop (2000 - 3000 times). After say 80
times, it gives me an error - The operation has timed out. If I continue by
pressing F10, the process starts again and everything is fine. After some
time again it will stop, show me an error on the line where I am calling
webservice and if i say F10, it will again continue.

I wanted to know how can I stop this "The operation has timed out" error
from coming. I have also set the Time Out property of web service to a large
value (1000000 ms), but still it doesn't help. I'm using .Net 2.0

Thanks,
Pooja.
Aug 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by willitfw | last post: by
1 post views Thread by Joško Šugar | last post: by
reply views Thread by Matt | last post: by
5 posts views Thread by Sachin Surana | last post: by
11 posts views Thread by Sumit Acharya | last post: by
10 posts views Thread by Jim Underwood | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.