[Mono-list] Problems serializing 'object' classes
lluis at ximian.com
Sat Jun 10 04:17:06 EDT 2006
The serializer needs to know all types involved in an object tree before
serializing it. If you are using a Mono web service client, the only way
to do it is by applying an attribute to the CORBAANy class:
[XmlInclude(typeof(yourclass))], or the the "value" property:
[XmlElement(typeof(yourclass))]. If you are using the XmlSerializer
directly, there is a constructor which takes an array of types, and you
can add there any type needed.
El ds 10 de 06 del 2006 a les 09:25 +0200, en/na Javier Fernandez va
> Im agree, 'value' is not a C# reserved keyword.
> But the problem keep unresolved.
> In general, how can i serialize a class, which one of their
> member is an 'object class'. I knonw this may have not sense
> in C#, but remember i start from a C CORBA environment and the
> stub clases generated from the WSDL are built from C data
> That is the reason of have an 'object class' as member of one
> concrete class.
> The question is, C# soap serialization, needs some help to known
> what class exactlily be the untyped member ? I said in previous mails
> that gsoap needs a special attribute in all structures which has
> 'untyped' ('any' type on CORBA) : int __type.
> This attribute is used by gsap to identify the type of the 'any' member.
> I dont knonw if i've explained well.
> Is imoprtant to me, because all this code is automatically generated
> and implies a great reduction in coding efforts. However, i always
> can do things manually :(
> Anyone has an idea ?
More information about the Mono-list