nillbiplob / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

Gzip encoding support #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Call a webservice with Accept-encoding: gzip in the header.

What is the expected output? What do you see instead?
A decoded stream. I get an exception "org.xmlpull.v1.XmlPullParserException: 
Unexpected token (position:TEXT 
‹��������������rZɒ�...@1:133 in 
java.io.InputStreamReader@412e6710)" 

What version of the product are you using? On what operating system?
Windows Vista, ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar

Please provide any additional information below.

Original issue reported on code.google.com by asousa.j...@gmail.com on 23 Jan 2012 at 7:53

GoogleCodeExporter commented 9 years ago
The Android version is 4.0.1

Original comment by asousa.j...@gmail.com on 23 Jan 2012 at 7:59

GoogleCodeExporter commented 9 years ago
Have you tried this 
http://stackoverflow.com/questions/4974963/ksoap2-android-and-gzipped-basichttpb
inding

Original comment by mosa...@gmail.com on 24 Jan 2012 at 12:28

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I've seen that post. I just posted the issue because I believe it should be 
included in the base code, since we are dealing with mobile devices and 
compression is important.

And anyway the http response contains the header indicating that the stream is 
compressed so Ksoap2 should at least throw a correct exception, like "GZIP not 
supported" instead of "unexpected token exception". 

Original comment by asousa.j...@gmail.com on 24 Jan 2012 at 7:26

GoogleCodeExporter commented 9 years ago
Sounds like a good idea. How about a pull request from you that does the error 
message or even better that implements unzipping.. 

Original comment by mosa...@gmail.com on 24 Jan 2012 at 7:30

GoogleCodeExporter commented 9 years ago
I'm a newbie on this but I'll try.

Original comment by asousa.j...@gmail.com on 24 Jan 2012 at 7:39

GoogleCodeExporter commented 9 years ago
The proposed fix in the stackoverflow post has been provided as pull request 
and merged into master. It will be available with the next release (2.6.5 or so)

Original comment by mosa...@gmail.com on 10 May 2012 at 6:52

GoogleCodeExporter commented 9 years ago
I should note that using 2.6.5-jar-with-dependencies it still does not detect 
gzip content. I extended HttpTransportSE, captured parseResponse and replaced 
the call to super with a new GZIPInputStream and it works.

Original comment by vlahakis...@gmail.com on 14 Jun 2012 at 2:07

GoogleCodeExporter commented 9 years ago
You should test with your own build off the master in github that would be a 
2.6.6-SNAPSHOT version.. 

Original comment by mosa...@gmail.com on 14 Jun 2012 at 5:41

GoogleCodeExporter commented 9 years ago
I fix this problem by using

if (hp.getKey().equalsIgnoreCase("Content-Encoding") && 
hp.getValue().equalsIgnoreCase("gzip")) 

instead of 

if (hp.getKey().equals("Content-Encoding") && hp.getValue().equals("gzip"))

Original comment by martinik...@gmail.com on 27 Aug 2012 at 1:31

GoogleCodeExporter commented 9 years ago
This change is already in master

Original comment by mosa...@gmail.com on 13 Sep 2012 at 5:24

GoogleCodeExporter commented 9 years ago
I'm using ksoap2 3.2.0 and i want to use Accept-encoding: gzip.
I see that is automatic from 2.6.5 but when i see the bytes that my app 
download they are the same that XML length records. I have a 600 bytes record 
and 283 record in server. I get about 190 kb from Web Service. 
How i can use ksoap2 with gzip? How can i know that im using gzip? Do i need to 
create the header with Accept-encoding?

Thanks. 

Original comment by daniel.m...@gmail.com on 17 Apr 2014 at 1:41