[Mono-devel-list] SoapFormatting

Jean-Marc André jean-marc.andre at polymtl.ca
Wed Apr 16 14:26:30 EDT 2003


Hello,

thanks for your response.

I'm pretty sure that the MS SoapFormatter 
(System.Runtime.Serialization.Formatters.Soap.SoapFormatter) is not only 
formatting the public fields and properties but also the private ones. 
As an exemple, here is how the MS soap formatter deals with the 
System.Collections.Queue class:

<a3:Queue id="ref-10" 
xmlns:a3="http://schemas.microsoft.com/clr/ns/System.Collections">
<_array href="#ref-11"/>
<_head>0</_head>
<_tail>3</_tail>
<_size>3</_size>
<_growFactor>200</_growFactor>
<_version>3</_version>
</a3:Queue>
<SOAP-ENC:Array id="ref-11" SOAP-ENC:arrayType="xsd:anyType[32]">
<item id="ref-12" xsi:type="SOAP-ENC:string">Hello</item>
<item id="ref-13" xsi:type="SOAP-ENC:string">World</item>
<item xsi:type="xsd:int">1</item>
</SOAP-ENC:Array>

I guess that *_array*, *_head*, .... are private fields as they aren't 
listed as public ones in the MS documentation.
And here is how the formatter I am working on deals with the same object:

    <a2:Queue id="ref-5" 
xmlns:a2="http://schemas.microsoft.com/clr/ns/System.Collections">
      <contents href="#ref-6" />
      <head>0</head>
      <count>3</count>
      <capacity>16</capacity>
      <growFactor>2</growFactor>
      <modCount>3</modCount>
    </a2:Queue>
    <SOAP-ENC:Array id="ref-6" SOAP-ENC:arrayType="xsd:anyType[16]">
      <item id="ref-7" xsi:type="SOAP-ENC:string">Hello</item>
      <item id="ref-8" xsi:type="SOAP-ENC:string">World</item>
      <item xsi:type="xsd:int">1</item>
    </SOAP-ENC:Array>

As you can see, a mapping can be done between the *_array* and *content* 
field but there is no *_tail* in the Mono class.
An interface like System.Runtime.Serialization.ISerializable could maybe 
solve a part of the problem ?

Jean-Marc

Miguel de Icaza wrote:

>Hello,
>
>  
>
>>I'm currently trying to implement the SoapFormatter class. The work is
>>in progress but I have one question about the compatibility with the MS
>>SOAP messages.
>>    
>>
>
>I assume you are talking about the SoapFormatter for remoting purposes. 
>There is some code on CVS.  But am afraid has not a very bright future
>due to the way it was implemented.
>
>  
>
>>I'm wondering if the Mono SOAP formatter should be able to read messages
>>formatted by the MS SOAP formatter and vice versa.
>>    
>>
>
>Yes, they should.  The question to be answered is which encoding does
>the SoapFormmater use.  There are two "formats":
>
>	* Soap Section 5 encoding.
>
>	* XML Schema-based encoding.
>
>I know that ASP.NET and some of the Web classes use the XmlSerializer
>manually, and not the Remoting version.
>
>  
>
>>I'm asking this question because many serializable classes of the Mono
>>and MS class libraries don't have the same field's name (sometimes, they
>>don't have the same number of fields) so it may be difficult to produce
>>the same messages.
>>    
>>
>
>We should look at each case, and study a solution.  The only fields that
>matter are public properties and fields, and those should pretty much be
>the same.
>
>Miguel
>
>  
>





More information about the Mono-devel-list mailing list