[Mono-list] Problems serializing 'object' classes

Javier Fernandez jfernandez at igalia.com
Thu Jun 8 16:52:59 EDT 2006


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. 

I don't undertand why this kind of objects are not serialized
correctly. 

Could anyone help me ?
Thanks, 


-- 
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