473,394 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 4066
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: willitfw | last post by:
Does anyone know how to prevent this error from occurring: IOError: (10060, 'Operation timed out'). I am using the following code without any luck. Obviously I am missing something. import...
1
by: Joško Šugar | last post by:
I have a data transfer between an c# application and web service. The application is in local network and connects to the internet thru a gateway. Connection is ADSL. Web service is on the remote...
0
by: Matt | last post by:
(can't find any of my previous post for same issue. please CC to my email address as well. Thanks!) Hi all, What is the possible reason that HttpWebRequest.GetRequestStream() may hang there...
5
by: Sachin Surana | last post by:
We use HttpWebRequest to send the request at a URL. But some times the method GetResponse throws a time out exception. But when we check the IIS logs, there is no such entry. So the request never...
4
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
2
by: tlan | last post by:
Hi, I got this error when I move my web service to Windows2003 server. I spent hours scouting on the internet and could find any answer. Please help!!! I the webservice is timeout between 1...
11
by: Sumit Acharya | last post by:
I am using following script to connect to the server and i try the connection for 1000 times. Some times it succeeds for all the 1000 times,but some times it fails with error:- 10060, 'Operation...
3
by: JuHui | last post by:
I wrote a script to get 100 pages from a server. like below: 1:import httplib 2:conns = httplib.HTTPConnection("www.mytest.com") 3:conn.request("GET", "/") sometimes a socket error was...
10
by: Jim Underwood | last post by:
I am having a problem with my web page timng out while retrieving a long runnign report (90-120 seconds. I have tried modifying several settings in various places and cannot get it to run for more...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.