Note that there are some explanatory texts on larger screens.

plurals
  1. POGZipStream over .NET webservice causes invalid character issue
    text
    copied!<p>I'm working on a complex .NET client server architecture customization and I absolutely have no control over request/reply sent or received except that I can add my stuff to the request/reply objects.</p> <p>I've a dataset on server side to be sent to client andI'm using GZipStream to compress the dataset. The compression works fine, but when the reply is received on client end, I get invalid character exception - 0x1F. I googled and could not find appropriate resource to address this issue. </p> <p>Compression code: </p> <pre><code>Private Function Compress(ByVal data() As Byte) As Byte() Try '---the ms is used for storing the compressed data--- Dim ms As New MemoryStream() Dim zipStream As Stream = Nothing zipStream = New GZipStream(ms, _ CompressionMode.Compress, True) '---or--- 'zipStream = New DeflateStream(ms, _ ' CompressionMode.Compress, True) '---compressing using the info stored in data--- zipStream.Write(data, 0, data.Length) zipStream.Close() ms.Position = 0 '---used to store the compressed data (byte array)--- Dim compressed_data(CInt(ms.Length - 1)) As Byte '---read the content of the memory stream into ' the byte array--- ms.Read(compressed_data, 0, CInt(ms.Length)) Return compressed_data Catch ex As Exception Return Nothing End Try End Function </code></pre> <p>Any idea to fix this issue considering the fact that I can alter the request/response handling mechanism is really appreciated. In addition, I also request any ideas on better ways handling large dataset transfers over webservice. Thank you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload