Bug 36411 - Soap Async calls doesn't seem to callback completed event args
Summary: Soap Async calls doesn't seem to callback completed event args
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 9.2
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2015-12-01 11:05 UTC by Gary Lowe
Modified: 2016-04-12 15:36 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED NORESPONSE

Description Gary Lowe 2015-12-01 11:05:18 UTC
This maybe related to Bug 36276 but there seems to be another issue using the latest mono framework.
We have some techs onsite doing an install.

They have a version of the application that was built before the latest update.
I made a change and built a new version using the latest tamarin update.

When the application loads it subscribes to the apps initialisation completed event args.

It then calls the apps async initialisation method.

It seems to hang here and eventually timeout. I cannot reproduce the problem here but it happens everytime for them onsite. If they roll back to the previous build it works fine.

The only thing in terms of logs they have been able to provide me are the following

2015-11-30T18:05:26: Exception: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. - System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. ---> System.Net.WebException: Aborted.
  at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) <0x1005b06a0 + 0x000f8> in <filename unknown>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol.AsyncGetRequestStreamDone (IAsyncResult ar) <0x100b002b0 + 0x00093> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary () <0x10050e1e0 + 0x00070> in <filename unknown>:0 
  at IG.Table.TableService.InitialiseTableDeviceCompletedEventArgs.get_Result () <0x10014c920 + 0x00017> in <filename unknown>:0 
  at IG.Table.LoginViewController+<HandleInitialiseTableDeviceCompleted>c__AnonStorey2.<>m__0 () <0x100159a10 + 0x0003b> in <filename unknown>:0 

Now I reverted back to to the previous version of Xamarin Studio and Xamarin.iOS and they still had the issue. I realised it was still using mono 4.2. I reverted back to 4.0.4 and rebuilt. The problem disappeared. I have currently updated everything back to the latest versions and just rolled back the mono framework to see if this still works.
I am awaiting them to test this on site.

Do you think this is related in someway to the changes that broke the creation of the event handlers and completed event args (36276)?
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-12-01 12:38:50 UTC
Yes, this could be related to related to bug #36276, but that should also be easy to test (check if the generated source code for web references changed, or alternatively use Mono 4.2 to build but without re-generating the source code for we b references).

Note that Xamarin.iOS itself barely uses the system mono, since all the mono runtime and BCL that is used in the app comes from Xamarin.iOS itself (another possibility is that it's a bug in the C# compiler (which comes from the system mono), but I find that unlikely).
Comment 2 Gary Lowe 2015-12-01 13:42:31 UTC
I have used the latest version to build
XS 5.10 (Build 871)
Xamarin.iOS 9.2
Mono 4.2 

I built the reference from another machine using an older version of Xamaarin
That is what produced the error above.

I built a version using...
XS 5.10 (Build 871)
Xamarin.iOS 9.2
Mono 4.0.4

This produced

2015-12-01T14:34:40: Exception: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. - System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. ---> System.Net.WebException: Aborted.
  at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) <0x1006186a0 + 0x000f8> in <filename unknown>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol.AsyncGetRequestStreamDone (IAsyncResult ar) <0x100b682b0 + 0x00093> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary () <0x1005761e0 + 0x00070> in <filename unknown>:0 
  at IG.Table.TableService.InitialiseTableDeviceCompletedEventArgs.get_Result () <0x1001b49b0 + 0x00017> in <filename unknown>:0 
  at IG.Table.LoginViewController+<HandleInitialiseTableDeviceCompleted>c__AnonStorey2.<>m__0 () <0x1001c1ab0 + 0x0003b> in <filename unknown>:0 
===========================================
2015-12-01T14:38:25: Exception: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. - System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. ---> System.InvalidOperationException: There is an error in XML document. ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
  at System.Net.WebConnection.BeginRead (System.Net.HttpWebRequest request, System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) <0x10062d1d0 + 0x00094> in <filename unknown>:0 
  at System.Net.WebConnectionStream.BeginRead (System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) <0x100631100 + 0x0024b> in <filename unknown>:0 
  at System.Net.WebConnectionStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) <0x100630fb0 + 0x00043> in <filename unknown>:0 
  at System.IO.StreamReader.ReadBuffer (System.Char[] userBuffer, Int32 userOffset, Int32 desiredChars, System.Boolean& readToUserBuffer) <0x10038c9f0 + 0x00163> in <filename unknown>:0 
  at System.IO.StreamReader.Read (System.Char[] buffer, Int32 index, Int32 count) <0x10038bf00 + 0x000ff> in <filename unknown>:0 
  at System.Xml.XmlTextReaderImpl.ReadData () <0x1006b5a70 + 0x00757> in <filename unknown>:0 
  at System.Xml.XmlTextReaderImpl.ParseEndElement () <0x1006b92c0 + 0x0006f> in <filename unknown>:0 
  at System.Xml.XmlTextReaderImpl.ParseElementContent () <0x1006b8070 + 0x0030f> in <filename unknown>:0 
  at System.Xml.XmlTextReaderImpl.Read () <0x1006b0d80 + 0x0005f> in <filename unknown>:0 
  at System.Xml.XmlTextReader.Read () <0x1006ae390 + 0x00023> in <filename unknown>:0 
  at System.Xml.XmlReader.ReadString () <0x1006a9130 + 0x0012f> in <filename unknown>:0 
  at System.Xml.XmlTextReader.ReadString () <0x1006ae5b0 + 0x00027> in <filename unknown>:0 
  at System.Xml.XmlReader.ReadElementString () <0x1006a9820 + 0x0011f> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadPrimitiveValue (System.Xml.Serialization.XmlTypeMapElementInfo elem) <0x100802b10 + 0x000ab> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) <0x100802950 + 0x0007f> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) <0x1007fff80 + 0x01503> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) <0x1007ffb20 + 0x0006b> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff930 + 0x001a7> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff800 + 0x0007f> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) <0x100802950 + 0x000cb> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadListElement (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, System.Object list, Boolean canCreateInstance) <0x100802cb0 + 0x00273> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) <0x1007fff80 + 0x00dd7> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) <0x1007ffb20 + 0x0006b> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff930 + 0x001a7> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff800 + 0x0007f> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) <0x100802950 + 0x000cb> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) <0x1007fff80 + 0x01503> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) <0x1007ffb20 + 0x0006b> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff930 + 0x001a7> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff800 + 0x0007f> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) <0x100802950 + 0x000cb> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadListElement (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, System.Object list, Boolean canCreateInstance) <0x100802cb0 + 0x00273> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) <0x1007fff80 + 0x00dd7> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) <0x1007ffb20 + 0x0006b> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff930 + 0x001a7> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff800 + 0x0007f> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) <0x100802950 + 0x000cb> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) <0x1007fff80 + 0x01503> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) <0x1007ffb20 + 0x0006b> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff930 + 0x001a7> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) <0x1007ff800 + 0x0007f> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) <0x100802950 + 0x000cb> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) <0x1007fff80 + 0x01503> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMessage (System.Xml.Serialization.XmlMembersMapping typeMap) <0x1007ff2d0 + 0x00337> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () <0x1007ff070 + 0x00147> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) <0x10080b110 + 0x000a7> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) <0x10080b110 + 0x001f8> in <filename unknown>:0 
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) <0x10080b090 + 0x0006b> in <filename unknown>:0 
  at System.Web.Services.Protocols.WebServiceHelper.ReadSoapMessage (System.Xml.XmlTextReader xmlReader, System.Xml.Serialization.XmlSerializer bodySerializer, System.Xml.Serialization.XmlSerializer headerSerializer, Boolean soap12, System.Object& body, System.Web.Services.Protocols.SoapHeaderCollection& headers) <0x100b6c160 + 0x001b3> in <filename unknown>:0 
  at System.Web.Services.Protocols.WebServiceHelper.ReadSoapMessage (System.Xml.XmlTextReader xmlReader, System.Web.Services.Protocols.SoapMethodStubInfo method, SoapHeaderDirection dir, Boolean soap12, System.Object& body, System.Web.Services.Protocols.SoapHeaderCollection& headers) <0x100b6c0e0 + 0x00067> in <filename unknown>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol.ReceiveResponse (System.Net.WebResponse response, System.Web.Services.Protocols.SoapClientMessage message, System.Web.Services.Protocols.SoapExtension[] extensions) <0x100b68bb0 + 0x00327> in <filename unknown>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol.AsyncGetResponseDone (IAsyncResult ar) <0x100b68470 + 0x0021b> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary () <0x1005761e0 + 0x00070> in <filename unknown>:0 
  at IG.Table.TableService.LoginCompletedEventArgs.get_Result () <0x1001b4aa0 + 0x00017> in <filename unknown>:0 
  at IG.Table.LoginViewController+<HandleLoginCompleted>c__AnonStorey1.<>m__0 () <0x1001c1740 + 0x00043> in <filename unknown>:0 
===========================================

I built a version using...
XS 5.10 (Build 871)
Xamarin.iOS 9.1.0.31
Mono 4.0.4

This works every time.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-12-01 19:08:35 UTC
OK, so it looks like it fails if you use Xamarin.iOS 9.2, even with an older system Mono.

Unfortunately the stack traces aren't enough for us to figure out what's happening, we'll need a test project we can execute ourselves.
Comment 4 Gary Lowe 2015-12-02 12:48:36 UTC
Thanks Rolf

I'm going to use the last setup for now as all our applications use the same method for obtaining and updating data.
Comment 5 Sebastien Pouliot 2016-04-12 15:36:33 UTC
We have not received further information and will assume this is not an issue anymore. If you can still affected by this please re-open the bug and include the requested information. Thanks.