473,804 Members | 3,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3735
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(10 24);
GZipOutputStrea m gzipStream = new GZipOutputStrea m(memoryStream) ;
ds.WriteXml(gzi pStream);
gzipStream.Fini sh();
memoryStream.Se ek(0, SeekOrigin.Begi n);

DimeAttachment dimeAttachment = new DimeAttachment( "applicatio n/x-gzip",
TypeFormat.Medi aType,memoryStr eam);
sc.Attachments. Add(dimeAttachm ent);

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

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

ms.Seek(0, SeekOrigin.Begi n);

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******@discu ssions.microsof t.com> wrote in message news:7A******** *************** ***********@mic rosoft.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
5768
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 an XMLDocument, then in my assembly, return that XMLDocument back to the dataset (if it is one), I will be good to go. Problem is, I haven't been able to find out how to transform a dataset into
3
9571
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, XmlWriteMode.IgnoreSchema) I would like to add <?xml version="1.0" ?>
5
10167
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 error "The Root Element is Missing" ... any help would be appreciated. Thanks, Rob Panosh
12
5317
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
1235
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 computer. The problem is that this database don't have any primary keys. Is there anyway I can load local database into a dataset and the webservice into a dataset
4
3606
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 sp's output will look something similar to this: <table1 column11="value111" column12="value112" column13="value113" /> <table1 column12="value121" column2="value122" column3="value123" /> <table2 column21="value211" column2="value212"...
2
1782
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 very simple: Dim ds As DataSet ds = ws.get_POItemsDS("504393") '-- dataset is populated here
7
3367
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 depending on peak access. I have built an XML file from SQL DB and pushed this file to web server. I want to load XML file at application startup and leave it cached if possible (it will vary in size from 1-2MB) and treat it like an SQL table...
11
2900
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. Flash just sees it as an object when it calls the web service. Thanks
0
10577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.