Bug 9600 - Web Reference error with auto-generated reference.cs file
Summary: Web Reference error with auto-generated reference.cs file
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web.Services ()
Version: 2.10.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-01-16 09:09 UTC by Allie Miller
Modified: 2015-03-25 16:22 UTC (History)
8 users (show)

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


Attachments
Reference file VS (106.72 KB, application/octet-stream)
2013-01-16 09:09 UTC, Allie Miller
Details
Reference file MonoTouch (255.83 KB, application/octet-stream)
2013-01-16 09:19 UTC, Allie Miller
Details


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 for Bug 9600 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Allie Miller 2013-01-16 09:09:23 UTC
Created attachment 3225 [details]
Reference file VS

When adding a web reference in a MonoTouch environment for a service1 Soap Client, which integrates perfectly in Visual Studio 2010 and 2012 in XP, Vista, 2000, W7 and W8 environments for both WP7 development and Android (MonoDroid plugin) development, it crashes runtime with the error message below.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: There was an error reflecting type 'OndoTest5.OndoService2.OndoUpdateOndoNode'. ---> System.Exception: There was an error reflecting field 'Any'. ---> System.Exception: The element Any has been attributed with an XmlAnyElementAttribute and a namespace '', but no name. When a namespace is supplied, a name is also required. Supply a name or remove the namespace.
at System.Xml.Serialization.XmlReflectionImporter.ImportAnyElementInfo (System.String defaultNamespace, System.Xml.Serialization.XmlReflectionMember rmember, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts) [0x000ab] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:1063
at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x000fe] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:835
at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x001e7] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:372
--- End of inner exception stack trace ---

The problem is within the auto generated reference.cs file. The workaround is to open a new WindowsApplication in Visual Studio 2005 (have tried VS2010 adn this didn't work9, setup my Web Reference, let it generate the reference.cs file, port it to a Mac into a MonoTouch application and now it works perfectly. When picking the VS2005 generated reference.cs file instead of the MonoTouch one, and change only 2 things: the namespace to fit the current project and then the "this.url" to point to the client soap service. 

Attached are the auto-generated reference.cs files from both Mono for Android and MonoTouch.

Complete MonoTouch error below:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: There was an error reflecting type 'OndoTest5.OndoService2.OndoUpdateOndoNode'. ---> System.Exception: There was an error reflecting field 'Any'. ---> System.Exception: The element Any has been attributed with an XmlAnyElementAttribute and a namespace '', but no name. When a namespace is supplied, a name is also required. Supply a name or remove the namespace.
at System.Xml.Serialization.XmlReflectionImporter.ImportAnyElementInfo (System.String defaultNamespace, System.Xml.Serialization.XmlReflectionMember rmember, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts) [0x000ab] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:1063
at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x000fe] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:835
at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x001e7] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:372
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0020b] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:376
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0006e] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:220
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00174] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:240
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x0003c] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:195
at System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts) [0x00196] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:987
at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x004c2] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:934
at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean writeAccessors, Boolean validate, XmlMappingAccess access) [0x0000d] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:157
at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean writeAccessors, Boolean validate) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:137
at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean writeAccessors) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:123
at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:110
at System.Web.Services.Protocols.SoapMethodStubInfo..ctor (System.Web.Services.Protocols.TypeStubInfo typeStub, System.Web.Services.Protocols.LogicalMethodInfo source, System.Object kind, System.Xml.Serialization.XmlReflectionImporter xmlImporter, System.Xml.Serialization.SoapReflectionImporter soapImporter) [0x003da] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs:208
at System.Web.Services.Protocols.SoapTypeStubInfo.CreateMethodStubInfo (System.Web.Services.Protocols.TypeStubInfo parent, System.Web.Services.Protocols.LogicalMethodInfo lmi, Boolean isClientProxy) [0x0005e] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs:531
at System.Web.Services.Protocols.TypeStubInfo.BuildTypeMethods () [0x0005d] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:200
at System.Web.Services.Protocols.TypeStubInfo.Initialize () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:177
at System.Web.Services.Protocols.LogicalTypeInfo.GetTypeStub (System.String protocolName) [0x00080] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/ServerType.cs:214
at System.Web.Services.Protocols.TypeStubManager.GetTypeStub (System.Type t, System.String protocolName) [0x00007] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:316
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor () [0x00006] in /Developer/MonoTouch/Source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs:82
at OndoTest5.OndoService2.Service1..ctor () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) OndoTest5.OndoService2.Service1:.ctor ()
at OndoTest5.MyOndos..ctor (IntPtr handle) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00109] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:530
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0011f] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:536
at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:545
at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00174] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:299
at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:234
at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:229
at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass) [0x0000d] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/Runtime.cs:231
at MonoTouch.ObjCRuntime.Runtime.GetNSObject (IntPtr ptr) [0x0001f] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/Runtime.cs:280
at MonoTouch.ObjCRuntime.Runtime.GetNSObjectWrapped (IntPtr ptr) [0x00000] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/Runtime.cs:297
at (wrapper native-to-managed) MonoTouch.ObjCRuntime.Runtime:GetNSObjectWrapped (intptr)
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
at OndoTest5.Application.Main (System.String[] args) [0x00000] in /Users/jangundorf/Projects/OndoTest5/OndoTest5/Main.cs:17
Comment 1 Allie Miller 2013-01-16 09:19:07 UTC
Created attachment 3226 [details]
Reference file MonoTouch
Comment 2 spyhunter73 2013-10-03 20:57:36 UTC
I can confirm this problem also exists on mono on ubuntu.

see http://ci.apache.org/builders/juddi-trunk-dotnet-mono/builds/44/steps/compile_1/logs/stdio
Comment 3 David Schulte 2014-10-15 13:58:06 UTC
Has there been any update on this issue? This seems to be a problem still with newer versions of Xamarin Studio. See my version details below.
Thanks,


Xamarin Studio
Version 5.5 (build 227)
Installation UUID: 6f7c36db-b063-41d3-aa0d-4184811018e8
Runtime:
	Mono 3.10.0 ((detached/47db868)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000019

Apple Developer Tools
Not Found

Xamarin.Mac
Version:

Xamarin.iOS
Version: 8.2.0.193 (Starter Edition)
Hash: 959c1e4
Branch: 
Build date: 2014-10-03 00:25:37-0400

Xamarin.Android
Version: 4.16.0 (Business Edition)
Android SDK: /Users/username/My Android/adt-bundle-mac-x86_64/sdk
	Supported Android versions:
		4.0.3  (API level 15)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
Java SDK: /usr
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Build Information
Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:53:38-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

Operating System
Mac OS X 10.9.5
Darwin hostname.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 4 David Schulte 2014-10-17 07:25:28 UTC
Again, is anyone looking at this?
Comment 5 gene 2015-03-25 16:22:44 UTC
Has a work around been found?
I am having the same problem.