Another option would be to do a binary serialization of the dataset,
passing the serialization output through the NZipLib compression stream
to a MemoryStream, and returning a byte array from the MemoryStream.
That ought to allow for even better compression, because you're not
compressing XML tags, you're eliminating them. It also ought to be
faster, because you're not generating an XML representation and then
converting it back to binary, you're just compressing the actual data.
If you go this route, you might run into problems doing a binary
deserialization on the other end using the NZipLib decompression stream
as the source. There's a bug in InflaterInputStream in NZipLib that
causes it to return a length of zero on a newly-initialized
InflaterInputStream - and the binary deserializer checks the stream's
length, and throws an exception if it's zero. It's a one-line fix to
the NZipLib source code - change the InflaterInputStream constructor to
initialize the length to a non-zero value, such as
baseInputStream.Length.
- Joel
> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]]
> On Behalf Of Robert Isaacs
> Sent: Thursday, May 02, 2002 12:36 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] HTTP Compression of XML WebServices
>
>
> The way you are doing this seems like a lot of work.
>
> I take the xml representation of the dataset and compress it
> into a byte array using NZipLib. The web service returns a
> byte array. On the client side, I then take the byte array,
> uncompress it into Xml, and then reinstantiate the dataset
> from the xml.
>
> We tend to get extremely high levels of compression this way
> (as you should with xml data).
>
> Thanks,
>
> Robert
>
>
> -----Original Message-----
> From: Carl Schei [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 02, 2002 1:27 PM
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] HTTP Compression of XML WebServices
>
>
> Hi There,
>
> I am trying to generically compress data between a thick
> windows client and a web service (thanks to
> http://discuss.develop.com/archives/wa.exe?A2=ind0203A&L=DOTNE
T&P=R47498
)
In order to do this I have created an HttpModule that adds a compression
filter to the response stream. All looks fine. The problem I am having
is in generically decompressing the data on the client side.
Essentially I need a handle to the response stream that arrives on the
client side. I can't seem to find any way of hooking into this process?
The web proxy doesn't seem to allow one to chain into the response
before it processes it.
Thoughts? How are people compressing Datasets between server and client?
The performance increases that we have seen are pretty large for an
average sized dataset!
hmmm, I am wondering whether I could target the datasets directly and
instead create a dataset subclass implementing a custom
serialiser/deserialiser involving compression/decompression.
Thanks,
- Carl
This communication contains information which is confidential and may
also be privileged. It is for the exclusive use of the intended
recipient(s). If you are not the intended recipient(s), please note that
any distribution, copying or use of this communication or the
information in it is strictly prohibited. If you have received this
communication in error, please notify the sender immediately and then
destroy any copies of it.
You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.