Results 1 to 1 of 1

Thread: Deserialization does not work for server

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    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
    Last edited by Techno; Mar 15th, 2006 at 08:05 AM.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width