开发者

Compress Object/String through webservice and consume in .net compact framework

We need to compress (or rather uncompress) some data we send to a pda client using a webservice.

Below I have a simple concept that will work if consumed by a regular .net app.

Unfortuantly, as the compact framework doesn't have the IO.Compression classes we can't see how this is possible without writing our own compression algorithms (as you'd don't have the ability to uncompress at the pda client end).

We have to use .net 2 only.

Dim c As New TestClass
c.Prop1 = "Test"
c.Prop2 = 1234

Dim XmlMemStream As New IO.MemoryStream
Dim mySerilizedObj As Xml.Serialization.XmlSerializer = New Xml.Serialization.XmlSerializer(GetType(TestClass))

mySerilizedObj.Serialize(开发者_开发问答XmlMemStream, c)

Dim gz As New IO.Compression.GZipStream(XmlMemStream, IO.Compression.CompressionMode.Compress, False)

This needs to be done at application level and not Server Level (HTTP compression).

Thanks


You could try using SharpZipLib on the client, I have used it successfully on Compact Framework.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜