Windows Phone ASP.NET Web Services Compression

I am developing an application for Windows Phone and iOS, and he needs to use the ASP.NET web service (SOAP developed by me). The amount of data that I upload through the web service is relatively large due to the inherent verbosity of XML. I would like to compress server responses to my SOAP calls using the IIS ISAPI compression module. On iOS, I use wsdl2objc, which works great. The Accept-Encoding: gzip,deflate header is present on calls from iOS / wsdl2objc. IIS properly compresses the answer that dandy works.

On Windows Phone, I use automatic SOAP wrappers, with a web service added as a Service Reference. It also (functionally) works fine. The application is functioning correctly, but the header sent by the generated code is Accept-Encoding: identity . I heard through the tubes that the generated code uses WebRequests that support gzip'd content.

Is there an acceptable way to 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 am using the ASP.NET web service, not the ASP.NET WCF service.

+4
source share
2 answers

It turns out that the main HTTP request request baked in WP7 SOAP has exactly 0 support for compressing GZIP / DEFLATE responses (or requests, for that matter). I am going to end up running my own SOAP class generator solution that uses WebRequest classes to do this.

0
source

http://www.sharpgis.net/post/2011/08/28/GZIP-Compressed-Web-Requests-in-WP7-Take-2.aspx

Has WebRequest and WebResponse, which include support for GZip. Their latest update says that you can register it to work with ANY WebRequest, but I have not tried this part myself. Therefore, if the code does use a standard web request under the hood, you should be good to go.

-1
source

Source: https://habr.com/ru/post/1441733/


All Articles