Subject: [Follow-up] Re: Recursive XML serialization? XML serialization of cyclic objects?
Date: Thursday 19th July 2007 20:00:20 UTC (over 10 years ago)
Just a follow-up to this old thread (sorry if it gets re-posted): (http://lists.ximian.com/pipermail/mono-list/2007-January/033886.html) > Andrés G. Aragoneses [ knocte ] wrote: >> > Robert Jordan escribió: >>>> >>> How can I send "myObject" via XML webservice for consumption? I am aware >>>> >>> that this is not possible to be XML-serialized with .NET1.1 but, can I >>>> >>> do it with 2.0 or Indigo? >>> >> I'm not aware of any Web Service standard allowing that >>> >> kind of cycles. >> > >> > Indigo (WCF) seems to support it! : >> > >> > http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/4e76b309c00eaf49/9235fd20edc55d7f#hdropenedd02799e0c3b43525 >> > >> > I will then be eager for olive to be released :D > It is possibly only with NetDataContractSerializer and cannot be > done with DataContractSerializer. Since NetDataContractSerializer > sucks in general (there is no point of using it instead of runtime > serialization), the priority is low at my hands. Indigo's "design > by contract" concept is becomes almost implicit (== practically > broken) when ISerializable objects are involved. > > Probably you could try runtime serialization with Soap formatter: > System.Runtime.Serialization.Formatters.Soap > > Atsushi Eno I've been so (lazy|busy) these months to not have tested this until now; and it just works! (Thanks Atsushi.) So I'm going ahead with the SoapFormatter. However, I have found out that a .NET2.0 WebService by default serializes my objects using normal XmlSerializer. Is there any configuration setting for it to use the SoapFormatter when returning a [Serializable] object from my [WebMethod]? BTW, I would also like to call a "SanityCheck()" method for every object that is returned from my webmethods before sending them. Can this be done without AOP? Regards, Andrés [ knocte ] -- _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list