[Mono-aspnet-list] InvalidOperationException: System.AsyncCallback cannot be serialized

RinatZakirov rinatzakirov at gmail.com
Wed Apr 15 22:03:10 EDT 2009


In my webapp I added an asynchronous Webmethod:
[code]
        [WebMethod]
        public IAsyncResult BeginReceiveMessages(string sessionId,
AsyncCallback cb, object s)
        {
...
            return asyncResult;
        }

        [WebMethod]
        public Message[] EndReceiveMessages(IAsyncResult call)
        {
            return new Message[0];
        }
[/code]

and get this error when run with apache/mod_mono and xsp2(note that the code
works beatifully in
Windows IIS):

[code]
System.AsyncCallback cannot be serialized because it does not have a default
public constructor

Description: HTTP 500. Error processing request.

Stack Trace:

System.InvalidOperationException: System.AsyncCallback cannot be serialized
because it does not have a default public constructor
  at System.Xml.Serialization.ReflectionHelper.CheckSerializableType
(System.Type type, Boolean allowPrivateConstructors) [0x00000] 
  at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping
(System.Xml.Serialization.TypeData typeData,
System.Xml.Serialization.XmlRootAttribute root, System.String
defaultNamespace) [0x00000] 
  at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping
(System.Xml.Serialization.TypeData typeData,
System.Xml.Serialization.XmlRootAttribute root, System.String
defaultNamespace) [0x00000] 
[/code]

-- 
View this message in context: http://www.nabble.com/InvalidOperationException%3A-System.AsyncCallback-cannot-be-serialized-tp23070222p23070222.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.



More information about the Mono-aspnet-list mailing list