[Mono-bugs] [Bug 404689] New: Cannot deserialize an array of base types that contains instances of derived types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jun 27 16:08:41 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=404689

User taktaktaktaktaktaktaktaktaktak at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=404689#c403829

           Summary: Cannot deserialize an array of base types that contains
                    instances of derived types
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: taktaktaktaktaktaktaktaktaktak at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


One cannot return an array of base types that contains instances of derived
types from a WebMethod.

If I have a test.asmx:
<%@ WebService Language="C#" Debug="true" class="foo"%>
using System.Web.Services;


public class foo
{
    public class MyBase
    {
        public string name;
    }

    public class MyDerived: MyBase
    {
        public int myDerivedID;
    }

  [WebMethod()]
  public MyBase[] blah()
  {
    return new MyBase[]{ new MyBase(), new MyDerived() };
  }
}


..and a client that invokes blah(), the result is: 
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>There
was an error generating the XML
document.</faultstring></soap:Fault></soap:Body></soap:Envelope>

The expected result is:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><blahResponse
xmlns="http://tempuri.org/"><blahResult><MyBase /><MyDerived
/></blahResult></blahResponse></soap:Body></soap:Envelope>

This seems conceptually related to #403829.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list