kvin024 / ksoap2-android

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

HttpTransport2SE can't handle gzipped data. #180

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use HttpTransport2SE "call" to contact a HTTP server, which responds with 
"Content-Encoding" = "gzip", and the response data gzipped.

What is the expected output? What do you see instead?

I expected that HttpTransport2SE would detect that the data is gzipped (this it 
does), and unzip the data and deliver the response.

What happens is that when HttpTransport2SE detects that incoming data is 
gzipped, and tries to call its method "getUnZippedInputStream(InputStream 
inputStream)", the ClassCastException e is catched; 
"java.lang.ClassCastException: java.io.BufferedInputStream cannot be cast to 
java.util.zip.GZIPInputStream."

What version of the product are you using? On what operating system?

ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar. Client is Samsung 
Tablet, Android 4.1.2, Server is com.sun.net.httpserver.HttpServer running on 
Windows 8.

Please provide any additional information below.

When I tested the communication between the kSOAP client and the http server 
without gzipping the data I worked perfectly. The problem occur when the server 
adds "Content-Encoding" = "gzip", and gzip's the response data.

I tried running the client both on Android and as a java program on the same 
computer, I still get "java.lang.ClassCastException: 
java.io.BufferedInputStream cannot be cast to java.util.zip.GZIPInputStream." I 
find this strange, since 
"http://developer.android.com/reference/java/util/zip/GZIPInputStream.html" 
indicates that this should be possible.

Original issue reported on code.google.com by dag....@eggum.net on 9 Jan 2014 at 11:38

GoogleCodeExporter commented 9 years ago
Quick update; after some debugging the error was in my HTTP-server, sending out 
bad gzip-data. After I fixed my server output it not works! :D 

I still get the "java.lang.ClassCastException: java.io.BufferedInputStream 
cannot be cast to java.util.zip.GZIPInputStream." though, but otherwise it 
works very well!

Original comment by dag....@eggum.net on 9 Jan 2014 at 2:37

GoogleCodeExporter commented 9 years ago
So can this issue be closed?

Original comment by mosa...@gmail.com on 29 Jan 2014 at 5:36

GoogleCodeExporter commented 9 years ago
Yes it can, it was a mistake on my part in the process of getting familiarized 
with ksoap2-android :)

Original comment by dag....@eggum.net on 29 Jan 2014 at 7:48

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 29 Jan 2014 at 7:58