Take a look at =
http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx and their =
DIME example.
Rather than returning the dataset, the server does something like this:
MemoryStream memoryStream =3D new MemoryStream(1024);
GZipOutputStream gzipStream =3D new GZipOutputStream(memoryStream);
ds.WriteXml(gzipStream);
gzipStream.Finish();
memoryStream.Seek(0, SeekOrigin.Begin);
DimeAttachment dimeAttachment =3D new =
DimeAttachment("application/x-gzip",
TypeFormat.MediaType,memoryStream);
sc.Attachments.Add(dimeAttachment);
And the client does this:
GZipInputStream gzipInputStream =3D new =
GZipInputStream(sc.Attachments[0].Stream);
MemoryStream ms =3D new MemoryStream(1024);
int nSize =3D 2048;
byte[] writeData =3D new byte[2048];
while (true)=20
{
nSize =3D gzipInputStream.Read(writeData, 0, nSize);
if (nSize > 0)=20
ms.Write(writeData, 0, nSize);
else=20
break;
}
=20
ms.Seek(0, SeekOrigin.Begin);
DataSet ds =3D 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.
[quoted text, click to view] "JoshKaos" <JoshKaos@discussions.microsoft.com> wrote in message =
news:7A312661-F36D-4141-B184-896547D1B43A@microsoft.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=20
> through the Dataset to populate the XMLDocument which is then passed =
to the=20
> Web application which then pushes the XMLDocument into a Dataset in =
order to=20
> use the data.
>=20
> Now my question is should I just skip the XMLDocument process and just =
pass=20
> the Dataset itself back from the WebService? Is there more overhead =
passing=20
> the Dataset back than passing the XMLDocument back? This webservice =
will be=20
> hit by between 50 to a 100 users on a constant basis so speed of data=20
> delivery is crucial.
>=20