Web Services Compression and the Compact Framework – Sample code from MEDC Oz

Tada, this is the tidied up Web Services Compression sample code from my Connectivity session at the MEDC Australia event.

The sample code was borrowed from http://www.businessanyplace.net/?p=wscompress2 🙂  Thanks guys!!

I’ve posted my sample code on Darren’s most excellent www.Projectdistributor.net at http://projectdistributor.net/Projects/Project.aspx?projectId=216 and it’s dependent on the “SharpZipLib” from http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx

If you update the Web Reference then you must go back and tweak the associated Reference.cs proxy file and add back the  [CompressionSoapExtension] attribute.

For example

[System.Web.Services.Protocols.SoapDocumentMethodAttribute(“http://tempuri.org/GetCompressedData”, RequestNamespace=”http://tempuri.org/”, ResponseNamespace=”http://tempuri.org/”, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public System.Data.DataSet GetCompressedData() {
object[] results = this.Invoke(“GetCompressedData”, new object[0]);
return ((System.Data.DataSet)(results[0]));

Cheers Dave

PS, sorry have turned off anonymous comments on my blog as it’s getting a ton of spam:(

That said I will post any comments that don’t include the words “longer”, “stronger” or “nasal delivery” 🙂

Comments (0)

Skip to main content