Deserialization does not work for server
more and more serialization/deserialization problems.
after figuring out the frustrating error message (namespace.class type was not expected....)
I am now able to serialize an arraylist. awesome.
so server serializes it:
Code:
Type[] extraTypes = new Type[1];
extraTypes[0] = typeof(ProgrammeTimes);
XmlSerializer serializer = new XmlSerializer(typeof(ArrayList), extraTypes);
serializer.Serialize(this.theNetworkStream, this.myClass.TheCollection);
and client recieves it and does this to DEserialize:
Code:
//writes the xml to file, then reads it from a streamReader
XmlSerializer theSerializer = new XmlSerializer(typeof(myClass[]));
myClass[] temp = (myClass[])theSerializer.Deserialize(theStreamReader);
theStreamReader.Close()
and I am able to successfully read the collection of objects to the type myClass. Cool!!
problem is that when I serialize from client (same code as server) and the Server tries to deserialize (same code as above) I get the error:
"<ArrayOfAnyType xmls="> was not expected
Any ideas? This is really frustrating - been 1 full day and have not progressed
The only difference really is the .NET framework. Server is 1.1 and client is 2.0 but that should not matter much when serializing i believe