R
Rade
I have an object, from .net remoting, using binaryformatter, I have a
way to stored it to a file. and then, I want to deserialize it and
serialize it again to Soap format. can this be done?
till now, I can deserialize it from binformatter to an object, but I
can't serialize to Soap(xml) format, it throws error.
I am using the function below, if the object class(stored in a file) is
created in the same project, it works fine. but not the object from
other programs, even if I have referenced the DLL files.
Anyone help me? it's really urgent, I am blocked here for a long time.
I hope you understand what I said, and give me a hand, thanks very
much.
public bool readBin2Soap(string fromFile, string toFile){
Stream stream = File.Open(fromFile, FileMode.Open);
sformatter = new SoapFormatter();
bformatter = new BinaryFormatter();
Object obj = (Object)bformatter.Deserialize(stream);
Stream stream2 = File.Open(toFile, FileMode.Create);
//till now, everything works fine, but not the
following step,
sformatter.Serialize(stream2, obj);//<--this one will throws error.
stream2.Close();
stream.Close();
return true;
}
way to stored it to a file. and then, I want to deserialize it and
serialize it again to Soap format. can this be done?
till now, I can deserialize it from binformatter to an object, but I
can't serialize to Soap(xml) format, it throws error.
I am using the function below, if the object class(stored in a file) is
created in the same project, it works fine. but not the object from
other programs, even if I have referenced the DLL files.
Anyone help me? it's really urgent, I am blocked here for a long time.
I hope you understand what I said, and give me a hand, thanks very
much.
public bool readBin2Soap(string fromFile, string toFile){
Stream stream = File.Open(fromFile, FileMode.Open);
sformatter = new SoapFormatter();
bformatter = new BinaryFormatter();
Object obj = (Object)bformatter.Deserialize(stream);
Stream stream2 = File.Open(toFile, FileMode.Create);
//till now, everything works fine, but not the
following step,
sformatter.Serialize(stream2, obj);//<--this one will throws error.
stream2.Close();
stream.Close();
return true;
}