[Mono-list] Problems serializing 'object' classes

Lluis Sanchez lluis at ximian.com
Fri Jun 9 05:30:17 EDT 2006


El dj 08 de 06 del 2006 a les 22:52 +0200, en/na Javier Fernandez va
escriure:
> Hi,
> I've developed a SOAP server using gsoap (2.7) and i'm trying 
> to build a C# client based on Mono .Net specification.
> 
> I've used Mico (2.3.11) to generate the WSDL from an IDL file.
> The gsoap C client runs fine, but when i tried to build the C#
> client i found some problems. 
> 
> The C# generated stub define the following structures : 
> 
> /// <remarks/>
> [System.Xml.Serialization.SoapType("CORBA.Any", Namespace="http://www.omg.org/IDL-Mapped/")]
> public class CORBAAny {
> 
>     /// <remarks/>
>     public CORBATypeCode type;
> 
>     /// <remarks/>
>     public int __type;
> 
>     /// <remarks/>
>     public object value;
> }
> 
> /// <remarks/>
> [System.Xml.Serialization.SoapType("CORBA.TypeCode", Namespace="http://www.omg.org/IDL-Mapped/")]
> public class CORBATypeCode {
> 
>     /// <remarks/>
>     [System.Xml.Serialization.SoapElement(DataType="anyURI")]
>     public string definition;
> 
>     /// <remarks/>
>     public string type_name;
> }
> 
> The '_type' field was manually aded to the WSDL specification. This is a limitation
> of gsoap, that needs information about the type of the generic value. In C# was 
> defined as 'object' class; in C it was defined as 'void *' . 
> 
> These clases are used to define abstract classes. For instance, 
> 
> ConcreteClass {
> 
> 	int att1
> 	int att2
> }
>  
> AbstractClass {
>  
> 	int att1;
> 	CORBAAny concrete;
> }
> 
> 
> When i tried to serialize the AbstractClass class, the 'concrete'
> field arrives to the gsoap server as undefined values. The normal 
> attributes of the concrete class are serialized corectly. 

What you mean by 'undefined values'? A concrete example of the
serialization output would help in diagnosing what's wrong.

Lluis.





More information about the Mono-list mailing list