[
Lists Home |
Date Index |
Thread Index
]
First, let me disclaim that I am still a bit of a novice, so I apologize for any offensively dumb questions or design decisions that follow. Also, I am using .NET's C#implementation...
The Background:
I am in the process of developing a client-server application that attempts to transfer files efficiently over the web. In its current form, the client breaks the file into pieces and stores each "chunk" in a DataSet object. Using the DataSet.WriteXml() method, I create and send a series of Xml documents, each with meta-data and a "chunk" of the file. The Xml documents are then loaded into a byte[] buffer and sent to the server. The server, in turn, receives the byte[] buffer, extracts the XML documents as strings and re-constructs the DataSet using DataSet.ReadXml(). All this would be great if I wasn't getting Xml exceptions thrown with great frequency. The two most common Xml exceptions I am seeing are 1) "There are multiple root elements. Line 36, position 17.", and 2) "This is an unexpected token. The expected token is 'EndElement'. Line 34, position 15."
I am unable to determine what is causing the first error, despite its frequency of occurence. There never seems to be anything problematic about Line 36, Position 17. It is, I believe the 3670th byte in the document.
I am able to determine the cause of the second error -- receipt of a partial Xml document. Basically, some portion of the document is not recieved and consequently there is no end element tag. I think this is the result of poor flow of control during client-server communication, but I'm still looking for the specific problem.
The Questions:
1) Can anyone offer suggestions as to how to diagnose/fix problem one?
2) Can anyone offer suggestions as to how to diagnose/fix problem two?
3) Has anyone had problems with .NET's DataSet.WriteXml() or DataSet.ReadXml()?
4) Can anyone point me to example code of a succesful implementation of sending and recieveing multiple Xml documents using .NET?
Thanks very much in advance for any assistance you can offer.
Best,
mcf
|