[Mono-bugs] [Bug 546360] New: Exception when consuming WebService - problems with complex object type deserialization

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 13 02:10:26 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=546360


           Summary: Exception when consuming WebService - problems with
                    complex object type deserialization
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: x86
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: gnorton at novell.com
        ReportedBy: Jochenvanwylick at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-us)
AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9

When consuming a webservice, I get an exception when I receive an object of a
type which I created myself on the server. In this case the MainEvent object,
with Name (string) and id(GUID) and description (string).

Exception text: 
Unhandled Exception: System.InvalidOperationException: There was an error
reflecting type 'Webservice.MainEvent'. ---> System.InvalidOperationException:
Webservice.MainEvent cannot be serialized because it does not have a default
public constructor
  at System.Xml.Serialization.ReflectionHelper.CheckSerializableType
(System.Type type, Boolean allowPrivateConstructors) [0x00000] 

Ofcourse - the MainEvent class ( which is a LINQ to SQL class ) has a public
constructor and the problem kan be solved using a similar trick as mentioned in
the SQLite tuorial:

var p = new Webservice.MainEvent();
var p = Webservice.GetMainEvent();

Problem's gone.

P.S. The tutorial I'm talking about is this one
http://conceptdev.blogspot.com/2009/09/monotouch-with-sqlite-corporate.html -
in the comments the 'missingMethod' problem is discussed. In both cases
constructors cannot be found when using reflection.

Reproducible: Always

Steps to Reproduce:
1. Add web reference to webevice
2. Receive a complex type object
3. See excpetion
Actual Results:  
Unhandled Exception: System.InvalidOperationException: There was an error
reflecting type 'Webservice.MainEvent'. ---> System.InvalidOperationException:
Webservice.MainEvent cannot be serialized because it does not have a default
public constructor
  at System.Xml.Serialization.ReflectionHelper.CheckSerializableType
(System.Type type, Boolean allowPrivateConstructors) [0x00000] 


Expected Results:  
No problems with consuming webservice.

-- 
Configure bugmail: http://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