[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Please help -- Xml errors during network transfer

  • To: xml-dev@l...
  • Subject: Please help -- Xml errors during network transfer
  • From: "Michael Fisher" <fish@e...>
  • Date: Thu, 28 Apr 2005 18:42:27 +0000
  • Importance: Normal

dataset.readxml
 
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.