-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for gzip encoding #197
Comments
Hah, this is interesting. Given that I'm both the maintainer of KArchive and of KDSoap, I can hardly object to KDSoap using KArchive :-) On the other hand, KArchive's main added value is archive-like formats (TAR, ZIP etc.), while simply gzipping can be done rather easily with zlib directly. In fact, KArchive's KCompressionDevice makes the API a bit nicer by behaving like a QIODevice, but that API isn't made for network-based data (push rather than pull, i.e. we can't just ask for more data from the underlying device and get it right away). I remember investigating that and arriving to that conclusion, see KFilterTest::test_pushData in the karchive autotests. There is actually code in KIO that implements on-demand deflating on top of KFilterBase, but we can't use that in KDSoap (due to the commercial license), it needs to be written from scratch. BTW does this end up using the standard HTTP "Accept-Encoding: [gzip|deflate|compress]" feature or is this a Microsoft extension done differently? I guess the latter, otherwise QNetworkAccessManager would do all this automatically for us, right? Anyhow, I am open to the contribution, but I suggest using zlib directly. |
Yeah I have just seen that yesterday, and I found it funny.
I have to double check the headers sent by the server, and check how the KDSOAP handles the Accept-Encoding headers.
Do you suggest to link to the zlib library, or I should add it as a submodule and include the sources directly? The linking option is more elegant, however we could ran into issues on Windows. |
The server sends the following headers (in the response to sending properly gzipped payload):
I have checked the QHttpNetworkReply code and it expects the "content-encoding" header to be set to "gzip" or "deflate", so this is something different: I have added zlib as a submodule, and mainly get it rolling, you can see my results here: I will work on adding some tests, and I would like to figure out how to proceed with #198 first. |
Ah indeed. This is HTTP sending a gzipped document, not HTTP itself using gzip encoding for a document. No idea why they do this, but OK, no way to handle this in QNetworkAccessManager (if you're downloading a .gz file, it should arrive compressed, not uncompressed). Thanks, I'll look at #198 now. |
I need to communicate with a webservice which requires gzip compression of the transmitted SOAP envelope.
I have a .NET+C# based example configured with source code available, so I have managed to figure out what needs to be compressed (whole envelope) and what content type (application/x-gzip) shall I send.
In the WSDL the GZIP compression is enabled by the following tag (so even kdwsdl2cpp could support it):
I will patch the KDSOAP to support his feature, and if I do so I would like contribute this change back to the upstream.
My questions would be the following:
The text was updated successfully, but these errors were encountered: