[Mono-bugs] [Bug 65654][Nor] New - XmlTextAttribute on field in derived class breaks SOAP reflector
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 9 Sep 2004 17:26:28 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by ldavismead@acculence.com.
http://bugzilla.ximian.com/show_bug.cgi?id=65654
--- shadow/65654 2004-09-09 17:26:28.000000000 -0400
+++ shadow/65654.tmp.29175 2004-09-09 17:26:28.000000000 -0400
@@ -0,0 +1,161 @@
+Bug#: 65654
+Product: Mono: Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Slackware 9.1
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Web.Services
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: ldavismead@acculence.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: XmlTextAttribute on field in derived class breaks SOAP reflector
+
+Description of Problem:
+Webmethod signature indicates a return type of base class, but returns an
+instance of a derived class. Derived class contains public field marked
+with [XmlText]. Page fails to compile.
+
+Testcase:
+<%@WebService Language="C#" Class="Foo.Test"%>
+
+using System;
+using System.Web;
+using System.Web.Services;
+using System.Xml.Serialization;
+
+namespace Foo
+{
+ // same symptoms even when base class is concrete
+
+ [XmlInclude(typeof(Derived))]
+ public abstract class Base {}
+
+ public class Derived : Base
+ {
+ [XmlText]
+ public string DerivedString = "Derived string.";
+ }
+
+
+ [WebService]
+ public class Test : WebService
+ {
+
+ [WebMethod]
+ public Base ReturnADerived()
+ {
+ return new Derived();
+ }
+ }
+}
+
+
+Actual Results:
+Scary mean stack trace (see attached).
+
+Expected Results:
+Happy soothing test form.
+
+How often does this happen?
+Always.
+
+Additional Information:
+Tested under mod_mono 1.0.1 with Apache 2.0.49. [XmlText] works as
+expected in base classes; derived classes work as expected without
+[XmlText] (so long as [XmlInclude] appears on base). Problem occurs only
+when [XmlText] appears in a derived class. Again, this problem occurs when
+trying to access the test form and causing the page to compile, not just
+invoking the method.
+
+Stack trace:
+System.ArgumentNullException: Argument cannot be null.
+Parameter name: CollectionBase.OnValidate: Invalid parameter value passed
+to method: null
+in [0x00010] (at
+/cvs/1-mono/mcs/class/corlib/System.Collections/CollectionBase.cs:88)
+System.Collections.CollectionBase:OnValidate (object)
+in [0x00002] (at
+/cvs/1-mono/mcs/class/corlib/System.Collections/CollectionBase.cs:105)
+System.Collections.CollectionBase:System.Collections.IList.Add (object)
+in [0x00007] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs:61)
+System.Xml.Schema.XmlSchemaObjectCollection:Add
+(System.Xml.Schema.XmlSchemaObject)
+in [0x000fe] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs:303)
+System.Xml.Serialization.XmlSchemaExporter:ExportMembersMapSchema
+(System.Xml.Schema.XmlSchema,System.Xml.Serialization.ClassMap,System.Xml.Serialization.XmlTypeMapping,System.Xml.Schema.XmlSchemaObjectCollection,System.Xml.Schema.XmlSchemaSequence&,System.Xml.Schema.XmlSchemaAnyAttribute&)
+in [0x001c1] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs:257)
+System.Xml.Serialization.XmlSchemaExporter:ExportClassSchema
+(System.Xml.Serialization.XmlTypeMapping)
+in [0x00283] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs:276)
+System.Xml.Serialization.XmlSchemaExporter:ExportClassSchema
+(System.Xml.Serialization.XmlTypeMapping)
+in [0x002ad] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs:473)
+System.Xml.Serialization.XmlSchemaExporter:GetSchemaElement
+(System.Xml.Schema.XmlSchema,System.Xml.Serialization.XmlTypeMapElementInfo,object,bool)
+in [0x000f9] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs:303)
+System.Xml.Serialization.XmlSchemaExporter:ExportMembersMapSchema
+(System.Xml.Schema.XmlSchema,System.Xml.Serialization.ClassMap,System.Xml.Serialization.XmlTypeMapping,System.Xml.Schema.XmlSchemaObjectCollection,System.Xml.Schema.XmlSchemaSequence&,System.Xml.Schema.XmlSchemaAnyAttribute&)
+in [0x0003e] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs:89)
+System.Xml.Serialization.XmlSchemaExporter:ExportMembersMapping
+(System.Xml.Serialization.XmlMembersMapping,bool)
+in [0x00003] (at
+/cvs/1-mono/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs:75)
+System.Xml.Serialization.XmlSchemaExporter:ExportMembersMapping
+(System.Xml.Serialization.XmlMembersMapping)
+in [0x0018f] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Description/SoapProtocolReflector.cs:200)
+System.Web.Services.Description.SoapProtocolReflector:ImportMessage
+(System.Xml.Serialization.XmlMembersMapping,System.Web.Services.Description.Message)
+in [0x0005b] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Description/SoapProtocolReflector.cs:95)
+System.Web.Services.Description.SoapProtocolReflector:ReflectMethod ()
+in [0x002c3] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolReflector.cs:344)
+System.Web.Services.Description.ProtocolReflector:ImportBindingContent
+(System.Web.Services.Description.ServiceDescription,System.Web.Services.Protocols.TypeStubInfo,string,System.Web.Services.Protocols.BindingInfo)
+in [0x000e6] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolReflector.cs:275)
+System.Web.Services.Description.ProtocolReflector:ImportBinding
+(System.Web.Services.Description.ServiceDescription,System.Web.Services.Description.Service,System.Web.Services.Protocols.TypeStubInfo,string,System.Web.Services.Protocols.BindingInfo)
+in [0x0009e] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolReflector.cs:246)
+System.Web.Services.Description.ProtocolReflector:ImportService
+(System.Web.Services.Description.ServiceDescription,System.Web.Services.Protocols.TypeStubInfo,string)
+in [0x000ac] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolReflector.cs:231)
+System.Web.Services.Description.ProtocolReflector:Reflect
+(System.Web.Services.Description.ServiceDescriptionReflector,System.Type,string,System.Xml.Serialization.XmlSchemaExporter,System.Xml.Serialization.SoapSchemaExporter)
+in [0x00022] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionReflector.cs:77)
+System.Web.Services.Description.ServiceDescriptionReflector:Reflect
+(System.Type,string)
+in [0x0001e] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs:220)
+System.Web.Services.Protocols.SoapDocumentationHandler:GetDescriptions ()
+in [0x00017] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs:109)
+System.Web.Services.Protocols.SoapDocumentationHandler:ProcessRequest
+(System.Web.HttpContext)
+in [0x00007] (at
+/cvs/1-mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs:72)
+System.Web.Services.Protocols.SessionWrapperHandler:ProcessRequest
+(System.Web.HttpContext)
+in [0x00091] (at
+/cvs/1-mono/mcs/class/System.Web/System.Web/HttpApplication.cs:444)
+ExecuteHandlerState:Execute ()
+in [0x0001e] (at
+/cvs/1-mono/mcs/class/System.Web/System.Web/HttpApplication.cs:708)
+StateMachine:ExecuteState (System.Web.HttpApplication/IStateHandler,bool&)