473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dataset vs. XMLDocument

I am in the process of rewriting a WebService. The WebMethods are all
returning XMLDocuments. First, they get a Dataset of records and then walk
through the Dataset to populate the XMLDocument which is then passed to the
Web application which then pushes the XMLDocument into a Dataset in order to
use the data.

Now my question is should I just skip the XMLDocument process and just pass
the Dataset itself back from the WebService? Is there more overhead passing
the Dataset back than passing the XMLDocument back? This webservice will be
hit by between 50 to a 100 users on a constant basis so speed of data
delivery is crucial.

Thanks,
Nov 23 '05 #1
1 3720
Take a look at http://www.icsharpcode.net/OpenSourc...b/Default.aspx and their DIME example.

Rather than returning the dataset, the server does something like this:
MemoryStream memoryStream = new MemoryStream(1024);
GZipOutputStream gzipStream = new GZipOutputStream(memoryStream);
ds.WriteXml(gzipStream);
gzipStream.Finish();
memoryStream.Seek(0, SeekOrigin.Begin);

DimeAttachment dimeAttachment = new DimeAttachment("application/x-gzip",
TypeFormat.MediaType,memoryStream);
sc.Attachments.Add(dimeAttachment);

And the client does this:
GZipInputStream gzipInputStream = new GZipInputStream(sc.Attachments[0].Stream);
MemoryStream ms = new MemoryStream(1024);
int nSize = 2048;
byte[] writeData = new byte[2048];

while (true)
{
nSize = gzipInputStream.Read(writeData, 0, nSize);
if (nSize > 0)
ms.Write(writeData, 0, nSize);
else
break;
}

ms.Seek(0, SeekOrigin.Begin);

DataSet ds = new DataSet();
ds.ReadXml(ms);
The net result of all of this is that you wind up passing the dataset as a zipped attachment - just like a zipped image.

"JoshKaos" <Jo******@discussions.microsoft.com> wrote in message news:7A**********************************@microsof t.com...
I am in the process of rewriting a WebService. The WebMethods are all
returning XMLDocuments. First, they get a Dataset of records and then walk
through the Dataset to populate the XMLDocument which is then passed to the
Web application which then pushes the XMLDocument into a Dataset in order to
use the data.

Now my question is should I just skip the XMLDocument process and just pass
the Dataset itself back from the WebService? Is there more overhead passing
the Dataset back than passing the XMLDocument back? This webservice will be
hit by between 50 to a 100 users on a constant basis so speed of data
delivery is crucial.

Thanks,

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt M | last post by:
Hey, I'm trying to pass an XML document from a webservice to another assembly. What I'd like to do is pass either an XML document or a dataset, so I figure that if I can turn the Dataset into...
3
by: Tom Vukovich | last post by:
and returning the xml to the requesting web page, how do you insert the XML declaration? ds.EnforceConstraints = False Response.ContentType = "text/xml" ds.WriteXml(Response.OutputStream,...
5
by: Rob Panosh | last post by:
Hello, I am trying to create a xmlDocument from as dataset. My code is listed below. All seems to go well until xmlDocument.Load(CType(ms, System.IO.Stream)) ... I keep getting the following...
12
by: Whoever | last post by:
Hi, I'm trying to return an XmlDocument or XmlNode converted from a typed dataset. public XmlNode whatever() { MyTypedDataSet ds = new MyTypedDataSet(); return new XmlDataDocument(ds); }
2
by: GTi | last post by:
I have a result from webservice query: XmlDocument doc = new XmlDocument(); XmlNode newSet = doc.ImportNode( ); doc.DocumentElement.AppendChild(newSet); I have the same database on my...
4
by: J.C.Rivera | last post by:
Hello... I'm a rookie to c#. So let me see if i can expose properly my situation. I developed a stored procedure in sql server 2000 that allows me to construct my dataset in XML format. the...
2
by: ilyagzak | last post by:
Hi, I have a dataset that I am trying to convert to xmldocument. I get a message: "The path is too long after being fully qualified. Make sure path is less than 260 characters." My code is...
7
by: =?Utf-8?B?ZG91Zw==?= | last post by:
Have loaded balanced web servers that we do not allow to connect to our database. Content is created and pushed to these sites. I want to add a web service that may get multiple requests a second...
11
by: casucci | last post by:
I do a return as XMLDataDocument in my webservice but it returns not with the namespaces etc in them. Anyone have and example where I can have the webservice return it as a XML. C# preferred....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.