On the web service end, I create the stream with xml data and then turn it
into a byte array. I then compress the byte array with the xceed component
and this returns a new byte array of compressed bytes. Can't remember if it
uses gzip or seomthing else but a quick look in the documentation should
tell you. That byte array is what I return from the web service.
On the client end, I basically do the reverse: decompress into a bytearray,
write the bytearray into a memory stream and then (since this is a dataset),
I readxml into the dataset.
I'm assuming I'll basically be able to do the same with the
system.io.compression goo in whidbey.
Here is the key part of the code using XCeed in VB:
Web Service
Dim ms As New System.IO.MemoryStream
ds.WriteXml(ms)
Dim bytearray(ms.Length) As Byte
bytearray = ms.GetBuffer
Dim CompressedBytes() As Byte
CompressedBytes = QuickCompression.Compress(bytearray,
CompressionMethod.Deflated, CompressionLevel.Normal)
Return CompressedBytes
Client that has received the compressedBytes byte array
Dim byteArray() As Byte = QuickCompression.Decompress(compressedBytes)
Dim ms As New MemoryStream
ms.Write(byteArray, 0, byteArray.Length)
ms.Position = 0
ds.ReadXml(ms)
Make sense?
hth
julie
-----Original Message-----
From: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Bill Bassler
Sent: Friday, March 25, 2005 10:52 AM
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] Bulk data transfer of xml-based data: Best
methods
RE: I use xceed's streaming compression for .net component to return large
(2-4
mb) xml docs from web services.
Question: When you say you compress the xml document and return from a web
service ... can you elaborate. Are you saying that after compression a web
service web method exposes/returns say a byte array containing the
compressed xml doc? And so the client simply needs to run a decompression
operation using the same algorithm (e.g. GZip)
===================================
This list is hosted by DevelopMentorR http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentor� http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com