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

User [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to