[Mono-list] Problems serializing 'object' classes

Javier Fernandez jfernandez at igalia.com
Sun Jun 11 06:06:00 EDT 2006


On Sat, Jun 10, 2006 at 10:17:06AM +0200, Lluis Sanchez wrote:
> Hi,
> 
> 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.
> 
> Lluis.
> 
> 


Thank you very much.

The generated C# stub from the WSDL wrote first
the Web Service class. Above this class, it was
added a '[System.Xml.Serialization.SoapInclude(typeof(class))] 
for all classes specified on WSDL. 

After the Web Service class defintion, the remain classes are 
defined, included the CORBAAny class. 
I just copied these directives, changing SoapInclude by XmlInclude
above the CORBAAny class. 

I made a test program to call XmlSerializer directly and examine
the xml ouput. The serializarion worked ok !!!

However, i still received wrong values on the gsoap server, 
but this may be another problems. I'll examine it.

Thanks again for your help.  


-- 
Javier Fernández García-Boente
Ingeniero en Informática                 
mailto:jfernandez at igalia.com                    
Igalia S.L. http://www.igalia.com
Telf. +34 981 91 39 91  
Fax.  +34 981 91 39 49
 


More information about the Mono-list mailing list