# IIS and gzip compression



## mruthven

I have a web service set up, being served from IIS 6.0. I have enabled compression in IIS, and it seems to be working, as I can use wfetch to create the following conversation:

started....
WWWConnect::Connect("192.168.0.37","80")\n
source port: 51454\r\n
REQUEST: **************\n
POST <sanitized>.asmx HTTP/1.1\r\n
Content-Type:application/soap+xml; charset=utf-8\r\n
Connection:close\r\n
Accept-Encoding:gzip\r\n
Host: <sanitized>\r\n
Accept: */*\r\n
Content-Length:531\r\n
\r\n
<?xml version="1.0"?>\r\n
<soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance"><soap12:Body><sanitized></soap12:Body></soap12:Envelope>\r\n
RESPONSE: **************\n
HTTP/1.1 200 OK\r\n
Cache-Control: private, max-age=0\r\n
Connection: close\r\n
Date: Mon, 29 Oct 2007 20:49:20 GMT\r\n
Content-Type: application/soap+xml; charset=utf-8\r\n
Server: Microsoft-IIS/6.0\r\n
X-Powered-By: ASP.NET\r\n
X-AspNet-Version: 2.0.50727\r\n
Content-Encoding: gzip\r\n
Vary: Accept-Encoding\r\n
Transfer-Encoding: chunked\r\n
\r\n
<sanitized gzip encoded response>
WWWConnect::Close("192.168.0.37","80")\n
closed source port: 51454\r\n
finished.

I'm connecting to the web service from a BlackBerry, and when I do that, this line gets added to the request header:
Via:MDS_4.1.0.35\r\n
And the responses don't get gzipped when this happens. Is there something in IIS that I have set up wrong, such that the "Via" property would interfere with the compression? For reference, I encounter the problem whether the request is actually being sent through the MDS Simulator or not, so I do not believe this has anything to do with the fact the request is coming from a BlackBerry.

Thanks,

Mike


----------



## Willian

Hello Friend, 
I'm having the same problem. 
Were you able to solve this problem? 
I need a help. 
Thank you, 
Willian


----------



## mruthven

I didn't get this problem solved explicitly, no, but by using https instead of http, the Via header cannot be added, and so the gzip compression works. Hope that helps!

Mike


----------



## Willian

Thank you very much


----------



## Willian

Hello, 
How did you do to achieve the connection by sending the certificate? 
I changed my webservice to https, but it is now the IIS is asking for the certified generated...
So I would like to ask you, what could I do to make the application open the connection and send the certified all together?!
Can you help me?
Thank you very much for all the help, 
Willian


----------



## mruthven

There shouldn't need to be any sending of certificates. You will need to generate a certificate for the web server and install it, and you should be good to go, no other changes needed (you may get asked to confirm the connection if you use a self-signed certificate).


----------



## Willian

You have used progress bar? 
I would add a progress bar to show the status of the connection. 
Could you help me?
Thank you very much for all the help, 
Willian


----------



## Willian

Hi.

I´m doing two requests to the web service and I get status 200. Therefore with the xml content, I call DataInputStream (I do know It got an exception but the error message comes with a null value) to unpack that data. Unfortunetly after that call, I receive the messages (MDS prompt log):

Received Packet for a timed out connection
Received an ack for non existing packet!

Regards,

Will


----------

