Compatibility with .NET GZipStream class? - WeOnlyDo Discussion board

Compatibility with .NET GZipStream class? (General questions)

by Paco Lianez, Monday, November 26, 2007, 17:32 (6206 days ago)

I have a C# WebService that returns a GZip compressed string in Base64. The code is:
...
[WebService(Namespace= http:... )]
public class WebSvc{

[WebMethod]
public string GetData() {

string text = Text to compress ;

byte[] buffer = Encoding.ASCII.GetBytes(text);
MemoryStream ms = new MemoryStream();
using (GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true))
{
zip.Write(buffer, 0, buffer.Length);
zip.Close();
}

ms.Position = 0;
MemoryStream outStream = new MemoryStream();

byte[] compressed = new byte[ms.Length];
ms.Read(compressed, 0, compressed.Length);

return Convert.ToBase64String(compressed);

}


In the client (a VB6 app), I call the WebService(with wodHttpDLX), extract the string from de XML (GetDataResult)and I want to decompress it with wodCrypt. The code:

Dim org as New MemBlob
Dim dst As New MemBlob
Dim zip As New wodCryptCom

zip.Type = None
zip.Compression = GZipCompression

org.FromBase64(GetDataResult)
zip.Decrypt org, dst <-- In this point I get error Failed to decompress data

Any ideas?

Thanks



Complete thread: