Bug 10888 - Exception when ASMX service call switches from Wifi to 3G/LTE
Summary: Exception when ASMX service call switches from Wifi to 3G/LTE
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-03-04 15:54 UTC by Kirk Gleason
Modified: 2017-03-22 12:45 UTC (History)
7 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 Kirk Gleason 2013-03-04 15:54:51 UTC
When using ASMX services, exceptions are thrown when the connection switches from Wifi to a cellular data connection:

System.Net.WebException: Error getting response stream (ReadDone1): ReceiveFailure ---> System.Exception: EndRead failure ---> System.Exception: Connection timed out
at System.Net.Sockets.Socket.EndReceive (IAsyncResult result) [0x0002d] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:1979
at System.Net.Sockets.NetworkStream.EndRead (IAsyncResult ar) [0x0002f] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:338
  --- End of inner exception stack trace ---

at System.Net.Sockets.NetworkStream.EndRead (IAsyncResult ar) [0x0003d] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:340 at System.Net.WebConnection.ReadDone (IAsyncResult result) [0x0002a] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebConnection.cs:429
  --- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00065] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:854 at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:860 at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse (System.Net.WebRequest request) [0x0000e] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientProtocol.cs:188

We've attached sample code for some simple apps to demonstrate this. In the attached code you'll find a simple iOS app written in MonoTouch and a simple SOAP web service. If you compile the app, and deploy it to a device, you should be able to recreate the issue by performing the following steps:

1. Compile code and deploy to an appropriate iOS device.
2. Connect to a Wifi network.
3. Run the app. 
4. Type in a number in the first text box. Then type a number in the second text box.  Tap the calculate button. The third text box should show the calculation from the first two textboxes. No exception should be thrown.
5. Turn off WiFi and turn on 3G.
6. Type a number in the first text box. Then type a number in the second text box. Tap the calculate button. The exception will show up on the right hand side of the textboxes.

Inside Archive.zip you will find SimpleServiceConsumer.zip and Simple_Web.zip. SimpleServiceConsumer is the iOS app, and SimpleServiceConsumer is the ASMX web service that we used for testing. Our version of the ASMX web service is still running and publicly accessible, should you want to use it rather than rolling your own.

We have tested this on several versions of MonoTouch going back to MT 4.x, but we haven't yet been able to test on anything newer than MonoTouch 6.0.6.
Comment 2 Andreas Fedele 2013-03-17 12:53:47 UTC
I have exactly the same problem.
Comment 3 tharealjohn 2013-05-01 13:53:26 UTC
I have also come across this issue. It seems to happen in flaky wifi/3G areas.
Comment 4 Joseph Hanna 2013-05-29 18:27:32 UTC
I also am getting this, several times per day from multiple iPads.
Comment 5 Suriya guru seelan 2014-06-12 13:57:49 UTC
I also am getting this, several times per day from my iPhone app
Comment 6 Koby 2014-06-30 03:29:12 UTC
Same problem here, getting this several times per day per user.
To be more specific i see this only from iphone/ipad running ios 6 not 7.
Comment 7 Koby 2014-06-30 03:33:46 UTC
I can confirm now it happens also in ios 7
Comment 9 Manuel de la Peña [MSFT] 2017-02-13 17:36:09 UTC
@Kirki can you provide the sample project? I'll test it with the current release, if we are ok, I'll close the bug for you.
Comment 10 Manuel de la Peña [MSFT] 2017-03-22 12:45:35 UTC
We have not received the requested information. If you are still 
 experiencing this issue please provide all the requested information 
 and re-open the bug report. Thanks!