[Mono-devel-list] problem whit soap serialization

manuel kaderli suntsu at suntsu.ch
Sun Feb 29 16:07:45 EST 2004


On Sunday 29 February 2004 21:09, Lluis Sanchez wrote:
> The namespace is System.Runtime.Serialization.Formatters.Soap,
> and the assembly is System.Runtime.Serialization.Formatters.Soap.dll
>
> You'll need to compile your app like this:
> mcs myapp.cs /r:System.Runtime.Serialization.Formatters.Soap.dll
>
> Lluis.

Hi

I tried it, but i get an error. I can compile the class, and i also used the 
[Serializable] in the classes i like to serialize.

//whit binary it works
using System.Runtime.Serialization.Formatters.Binary;
    Stream streamWrite = File.Create("SunDms.bin");
    BinaryFormatter binaryWrite = new BinaryFormatter();
    binaryWrite.Serialize(streamWrite, sd);
    streamWrite.Close();

//whit soap, don't work
using System.Runtime.Serialization.Formatters.Soap;
    Stream streamWrite = File.Create("SunDms.xml");
    SoapFormatter soapWrite = new SoapFormatter();
    soapWrite.Serialize(streamWrite, sd);
    streamWrite.Close();

//error while executing
System.ArgumentException: An invalid argument was specified.
in (unmanaged) /usr/local/lib/libmono.so.0(mono_raise_exception+0x1f) 
[0x400918ff]
in (unmanaged) /usr/local/lib/libmono.so.0 [0x400c12b6]
in <0x00028> (wrapper managed-to-native) 
System.Globalization.CultureInfo:construct_internal_locale (string)
in <0x00083> System.Globalization.CultureInfo:Construct (int,string,bool)
in <0x00098> System.Globalization.CultureInfo:.ctor (string,bool)
in <0x00012> System.Globalization.CultureInfo:.ctor (string)
in <0x0012b> System.Runtime.Serialization.Formatters.Soap.SoapWriter:.ctor 
(System.IO.Stream)
in <0x000af> 
System.Runtime.Serialization.Formatters.Soap.SoapFormatter:Serialize 
(System.IO.Stream,object,System.Runtime.Remoting.Messaging.Header[])
in <0x00019> 
System.Runtime.Serialization.Formatters.Soap.SoapFormatter:Serialize 
(System.IO.Stream,object)
in <0x00203> .TestClient:Main ()


kind regards




More information about the Mono-devel-list mailing list