[Mono-bugs] [Bug 69186][Wis] New - [XmlInclude] should generate xsd:import in wsdl:types
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 6 Nov 2004 14:04:53 -0500 (EST)
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=69186
--- shadow/69186 2004-11-06 14:04:53.000000000 -0500
+++ shadow/69186.tmp.11736 2004-11-06 14:04:53.000000000 -0500
@@ -0,0 +1,78 @@
+Bug#: 69186
+Product: Mono: Class Libraries
+Version: 1.0
+OS: GNU/Linux [Other]
+OS Details: Linux from Scratch (mono built from tarball)
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: ldavismead@acculence.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [XmlInclude] should generate xsd:import in wsdl:types
+
+mono 1.0.4
+
+Firstly, this could be construed as a feature request, although it's how a
+certain other somewhat popular .NET platform implements it. Secondly, I'm
+not entirely sure where this would be implemented...I filed it under
+System.Xml, since that's where XmlIncludeAttribute lives, but it's more
+likely going to affect the SOAP reflector or some other bit of the web
+services runtime.
+
+If I decorate a type with an [XmlInclude] attribute in MS.NET, if that type
+is exposed through a web service, then the including type will contain an
+xsd:import element referencing the included type. Mono currently does
+include the other type, insofar as the schema appears in the wsdl:types
+section, but it does not generate the schema import element. An example:
+
+[XmlType(Namespace="FooNamespace", TypeName="Foo")]
+[XmlInclude(typeof(Bar))]
+public class Foo
+{
+}
+
+[XmlType(Namespace="BarNamespace", TypeName="Bar")]
+public class Bar : Foo
+{
+}
+
+The schemas generated when Foo is exposed through a web service (as a
+return type, for example) look something like the following (certain bits
+snipped to make this prettier):
+
+<xsd:schema targetNamespace="FooNamespace">
+ <!-- MS.NET generates this, mono does not -->
+ <xsd:import namespace="BarNamespace" />
+
+ <xsd:complexType name="Foo" />
+</xsd:schema>
+
+<!-- MS.NET and mono both generate this schema similarly -->
+<xsd:schema targetNamespace="BarNamespace">
+ <xsd:import namespace="FooNamespace" />
+ <xsd:complexType name="Bar">
+ <xsd:complexContent mixed="false">
+ <xsd:extension xmlns:q1="FooNamespace" base="q1:Foo" />
+ </xsd:complexContent>
+ </xsd:complexType>
+</xsd:schema>
+
+
+Although I could see the xsd:import in question as being considered
+superfluous, to my mind the point of the [XmlInclude] attribute is to
+explicitly link two types. In my application, I have full control over the
+client's behaviour with regard to loading the type definitions from WSDL,
+so I can blithely load any and all schemas present in the wsdl:types
+section. However, it would be nice if I could simply follow an import
+chain and be guaranteed to have loaded all types that will be needed for a
+specific schema, which is in fact how I was doing it until I discovered
+this behaviour in mono.
+
+Thanks!
+Liam Davis-Mead