I am developing an app for both Windows Phone and iOS, and it needs to consume an ASP.NET web service (SOAP, developed my me). The amount of data that I download through the web service is relatively large, due to the inherent verbosity of XML. I’d like to compress the server’s responses to my SOAP calls, using IIS’s ISAPI compression module. On iOS, I am using wsdl2objc, which works great. The Accept-Encoding: gzip,deflate header is present on calls from iOS/wsdl2objc. IIS properly compresses the response, which works dandy.
On Windows Phone, I am using the auto-generated SOAP wrappers, with the web service added as a Service Reference. This also (functionally) works just fine. The app functions properly, but the header sent by the generated code is Accept-Encoding: identity. I’ve heard through the tubes that the generated code uses WebRequests, which support gzip’d content.
Is there an accepted way to either add the Accept-Encoding: gzip header on the phone side, or return a compressed Content-Encoding: gzip response from the server?
Thanks in advance!
Note: I’m using an ASP.NET Web Service, NOT an ASP.NET WCF service.
Turns out the underlying HTTP request magic baked into WP7’s SOAP implementation has exactly 0 support for GZIP/DEFLATE compression of responses (or requests, for that matter). I’m going to end up rolling my own SOAP class generator solution, that uses the
WebRequestclasses to do it.