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,