473,804 Members | 3,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebService and timeout

Hi.

I'm dealing with scenario when call to any web method ends up with timeout
and I try to add the user a chance to retry (wait a little bit)
My service proxy code looks like this:

AsyncCallback cb = new AsyncCallback(S erviceCallback) ;
IAsyncResult result1 = BeginInvoke(met hodName, parameters, cb, this);
if(result1.IsCo mpleted == false)
{
while(true)
{
bTO = result1.AsyncWa itHandle.WaitOn e(Timeout, true);
if(bTO == false)//time out occured
{
//display window and ask the user to wait a moment, user press
OK when it sure that web method finished
}
if(result1.IsCo mpleted)
break;
}
object[] ret = EndInvoke(resul t1);// error every time when time out
occured (bTO = false)
}
My scenario is following:
1. BeginInvoke initialize asynch web method call
2. WaitOne waits for Timeout miliseconds
3. WaitOne returns false because timeout occured, and wait screen is
displayed. When user close it the web methos is finished.
4. result1.IsCompl eted is true so I expect that EndInvoke shall return the
results but it throws excpetion "timeout" !!!. Why?
Everything works fine if timeout doesn't occure.

Thanks for any advise
Shark

Jun 27 '08 #1
2 3465
Have you tried calling this synchronously? If it is going to time out and
you need to get your results before you can go any further, calling it
asynchronously isn't going to help any.
Peter
"shark" <ma**@poczta.on et.plwrote in message
news:fv******** **@news.onet.pl ...
Hi.

I'm dealing with scenario when call to any web method ends up with timeout
and I try to add the user a chance to retry (wait a little bit)
My service proxy code looks like this:

AsyncCallback cb = new AsyncCallback(S erviceCallback) ;
IAsyncResult result1 = BeginInvoke(met hodName, parameters, cb, this);
if(result1.IsCo mpleted == false)
{
while(true)
{
bTO = result1.AsyncWa itHandle.WaitOn e(Timeout, true);
if(bTO == false)//time out occured
{
//display window and ask the user to wait a moment, user press
OK when it sure that web method finished
}
if(result1.IsCo mpleted)
break;
}
object[] ret = EndInvoke(resul t1);// error every time when time out
occured (bTO = false)
}
My scenario is following:
1. BeginInvoke initialize asynch web method call
2. WaitOne waits for Timeout miliseconds
3. WaitOne returns false because timeout occured, and wait screen is
displayed. When user close it the web methos is finished.
4. result1.IsCompl eted is true so I expect that EndInvoke shall return the
results but it throws excpetion "timeout" !!!. Why?
Everything works fine if timeout doesn't occure.

Thanks for any advise
Shark
Jun 27 '08 #2
Yes, synchronously it works fine, but I try to get the user a possibility to
wait longer than 'timeout'.
My scenario shall looks:
1. Init asynchronously call
2. Wait for results
3. If timeout goto 2 else if IsCompleted goto 3
4. Call EndInvoke to get the results.

It seems that calling EndInvoke in case earlier timeout occured ends up with
TimeOut exception. Why?

Thx


"Peter Bromberg [C# MVP]" <pb*******@nosp ammin.yahoo.com wrote in message
news:47******** *************** ***********@mic rosoft.com...
Have you tried calling this synchronously? If it is going to time out and
you need to get your results before you can go any further, calling it
asynchronously isn't going to help any.
Peter
"shark" <ma**@poczta.on et.plwrote in message
news:fv******** **@news.onet.pl ...
>Hi.

I'm dealing with scenario when call to any web method ends up with
timeout and I try to add the user a chance to retry (wait a little bit)
My service proxy code looks like this:

AsyncCallbac k cb = new AsyncCallback(S erviceCallback) ;
IAsyncResult result1 = BeginInvoke(met hodName, parameters, cb, this);
if(result1.IsC ompleted == false)
{
while(true)
{
bTO = result1.AsyncWa itHandle.WaitOn e(Timeout, true);
if(bTO == false)//time out occured
{
//display window and ask the user to wait a moment, user press
OK when it sure that web method finished
}
if(result1.IsCo mpleted)
break;
}
object[] ret = EndInvoke(resul t1);// error every time when time out
occured (bTO = false)
}
My scenario is following:
1. BeginInvoke initialize asynch web method call
2. WaitOne waits for Timeout miliseconds
3. WaitOne returns false because timeout occured, and wait screen is
displayed. When user close it the web methos is finished.
4. result1.IsCompl eted is true so I expect that EndInvoke shall return
the results but it throws excpetion "timeout" !!!. Why?
Everything works fine if timeout doesn't occure.

Thanks for any advise
Shark
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2662
by: Jack Wright | last post by:
Dear All, I have observed that if I call a synchronous WebService from my aspx page then even if I set oProxy.TimeOut = 1000, the WebService thread execution is still running... Since my WebService might run a big query that a client has written, it eventually recycles my workerprocess... How to I abort the WebService execution I tried to set httpRuntime executionTimeout in my Web.Config and Machine.config... <httpRuntime...
1
1536
by: Vai2000 | last post by:
Hi All, What's the difference between Timeout on the Webservice proxy object and Timeout on the auto generated Proxy // foo.aspx.cs localhost.MyWebSvc svc=new localhost.MyWebSvc(); svc.Timeout=1000; // auto generated proxy
0
1377
by: Steve Schaenzer | last post by:
Hello, I have a windows client that makes a WebService call on regular intervals using a timer. This call is very simple and always takes a very short time to reply. However about every one in ten tries the Call receives a mysterous timeout error. This is very annoying for my users because since it is a syncronus call it locks up the interface for the duration of the timeout period. I was doing some investigation by watching the...
2
11214
by: wcchan | last post by:
Hi, We set debug="false" at web.config of a WebService for performance sake. We found that after set, the web service request will sometimes got a timeout exception. Would anyone tell me how long the web service request be timeout and how to configure the timeout limit of the webservice calls? Thanks advance.
7
2029
by: Alessandro Benedetti | last post by:
Hi. I'm calling two methods of a .NET Webservice (A) from another Webservice (B). The A Webservice is made like this: public class WSA: System.Web.Services.WebService { private int X = 0;
7
1804
by: Robbert van Geldrop | last post by:
Hello, I have a problem in a C# client that consumes a webservice which is wrapped by WSE 2.0 sp3: The WebService works fine but very rarely my client comes in a state where every call to the webservice results in a timeout exception. Meanwhile all my other internet traffic passes normally so the problem implicitly exists between my client and the WebService.
0
1094
by: Dmitry Markin | last post by:
I've met one strange occurence with webservices - I use webservice as a server and win32 application as a client, after some time of usage any call to webservice results into a timeout... seems that after any single timeout all futher calls will also result into one.. I've traced http traffic and found out that application doesn't even try to send any data to web server. That cannot be a web server problem for sure, because another copy...
1
2021
by: intrepid_dw | last post by:
All: I have prepared a .NET 1.1 client application that consumes a remote, public web service. All the functions work as expected, and, in general, the application has been successful for my purposes. I have discovered one bit of behavior that surprises me, however. At certain times, under heavy server-side loads, my calls to certain web service methods will time out on the *client* side (proxy timeout). My assumption was that the...
4
58470
by: =?Utf-8?B?c2FtZWVy?= | last post by:
environment : .net framework 1.1, ado.net, visual studio 2003, vb, sqlsever 2000, winforms, webforms I want to increase the timout of the webservice in the application which is being used in a huge number of places and this woudl take me forever if i do it indivisually, is there any way i can increase the timeout globally by something like specifying in the config file? thanks sameer
4
51145
by: Simon | last post by:
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
0
9571
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.