Bug 6348 - Webservice (ASMX) Async Timeout
Summary: Webservice (ASMX) Async Timeout
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.2.x
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-08-01 04:44 UTC by woodyj007
Modified: 2017-06-28 14:19 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description woodyj007 2012-08-01 04:44:07 UTC
Calling any of the methods in webservices (written in Asmx) using the Async() does not fire the completed event if you use an unavailable service address.

Changing timeout makes no difference.

I've tested the same functionality in a a .Net application (2.0 and 4.0) and both work as expected.  Completed is fired with error info in the CompletedEventArgs.

If I don't use async and call the method synchronously, timeout is respected and running the call in a try|catch will give me an error.  

I've also tested this in java using AsyncTask and again that works as expected so there is a bug somewhere in the implementation of async webservice calls/completed returns.

Comment 1 woodyj007 2012-08-01 10:31:17 UTC
Just a quick note to say that if this could be fixed asap that would be great.

At the moment before I call an Async webcall method I show a progress dialog that is set to not cancelable.  This dialog is closed when the async completes.  So when the webservice is unavailable (server off, bad network etc...) completed isn't fired and the user gets an indefinite waiting progress dialog.  My solution at the moment is to make the progress dialog cancelable so they can cancel out but I really would like to show a 'Connection Error' message which at the moment I just can't trap.
Comment 2 woodyj007 2012-08-01 12:00:40 UTC
Sorry one more update to this bug.  This ONLY happens when on a carrier network (i.e. Orange, Vodafone etc.).  When I switch to Wifi it works fine.  I've tested it on multiple devices on two different carrier networks.

I'm in the uk rural based so we only get 2G connections here so maybe it's a speed  issue?
Comment 4 Miguel de Icaza [MSFT] 2013-05-22 16:16:41 UTC
Are you still experiencing this problem?

This might be an Android stack problem
Comment 5 Jonathan Pryor 2014-01-13 12:04:53 UTC
This _might_ be a duplicate of Bug #12640.

Please try on Xamarin.Android 4.10.0, which has the fix for Bug #12640.
Comment 6 Chris Hardy [MSFT] 2017-06-28 14:19:39 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!