Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi everybody,

I'm developing an application for Windows CE 6.0 using .Net CF 2.0.
I have an auto-generated client for an ASP.NET web service.
Is it possible to set the client in such a way it would use gzip/deflate compression when communicating with the web-service ?

Unfortunately, I didn't manage to find out any related properties or methods for this task.

Can anybody help me with this ?

Thanks,
Alex
Posted
Updated 24-May-12 2:25am
v2
Comments
Alex-1978 24-May-12 10:35am    
I've found out a part of a solution for this problem: I've overridden GetWebRequest() method of the web-client and implemented adding of 'Accept-Encoding' header, so now I can see 'Accept-Enconding: gzip, deflate' is sent to the server, but the answer is still not compressed.
Looks like the web-service needs to be configured in a way to support this.
I saw an advice to add the following section into web.config:

<pre lang="xml"><system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="text/xml" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="text/xml" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer></pre>

but it didn't help me.

Can anybody say what it is necessary to do ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900