mostlylucid

scott galloway's personal blog...
posts - 909, comments - 723, trackbacks - 11

My Links

News

Archives

Post Categories

Misc. Coding

Article on CodeProject on adding a Zip filter to Web Services

This is really a pretty slick way of adding Zip support to all .NET web service calls (which I've just noticed also references an old post of mine yay!). Even though this is very slick, I still yearn for a way to apply a simple modification to the proxy class to support the native HTTP 1.1 compression stuff...anyone...?

Print | posted on Sunday, July 18, 2004 10:59 PM | Filed Under [ .NET ASP.NET ]

Feedback

Gravatar

# re: Article on CodeProject on adding a Zip filter to Web Services

china love you
7/21/2004 11:10 AM | 中国软件站
Gravatar

# re: Article on CodeProject on adding a Zip filter to Web Services

And I love china...feelin' a whole lotta love right now...:-)
7/21/2004 6:35 PM | Scott Galloway
Gravatar

# re: Article on CodeProject on adding a Zip filter to Web Services

I'm running into a problem with a bounds error in the Compress Method at "Stream s = OutputStream(ms);" It doesn't seem to step into the OutputStream method, simply error out with a bounds error message about the index needing to be non-negative and less than the size of the collection.

Any suggestions on what might be wrong? Or better yet how to fix it?
7/29/2004 9:46 PM | James Drudge
Gravatar

# re: Article on CodeProject on adding a Zip filter to Web Services

Interesting, are you using the BZip2 stream by any chance? There was (is?) a bug in the SharpZipLib implementation of this...try it with a different compression provider (say gzip). If not, I'll need more information to establish the problem...
7/29/2004 9:50 PM | Scott Galloway
Gravatar

# re: Article on CodeProject on adding a Zip filter to Web Services

Unfortunately I am already using GZip. I'll see what I can dig up in the way of better info. Thanks for the quick reply.
7/30/2004 4:17 PM | James Drudge
Gravatar

# re: Article on CodeProject on adding a Zip filter to Web Services

Very strange...I haven't seen that error, can you send a sample of the code you're using to me (scott_spam2@mostlylucid.co.uk), thanks.
7/30/2004 4:20 PM | Scott Galloway
Gravatar

# re: Article on CodeProject on adding a Zip filter to Web Services

We have a .NET 1.1 client which is sending a gzipped soap request using
HttpWebRequest to an Apache server. The Apache server is using the
'mod_deflate' filter to decompress the incoming message, and to also compress
the response (GZIP).

The mod_deflate filter requires the 'Content-Length' header contained within
the incoming request to specify the number of UNCOMPRESSED bytes being sent
and not the actual bytes of the body of the compressed HTTP request itself.
The problem we have is .NET requires that you specify the number of actual
bytes written to the request stream as specified in the Content-Length header
of the request message. The exception we receive when attempting to close
the stream to send the request is:

[System.IO.IOException]: {System.IO.IOException}
HelpLink: Nothing
InnerException: Nothing
Message: "Cannot close stream until all bytes are written."
Source: "System"
StackTrace: " at System.Net.ConnectStream.CloseInternal(Boolean
internalCall, Boolean ignoreShutDownCheck)"
TargetSite: {System.Reflection.RuntimeMethodInfo}

Is there any way around this issue?
12/15/2004 9:21 PM | PerryG
Comments have been closed on this topic.

Powered by: