zengxie / ksoap2-android

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

Exception when call web service method #181

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When you call the Web service exception occurs:

01-30 11:26:22.959: E/FMTN(20460):  at 
android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
01-30 11:26:22.959: E/FMTN(20460):  at 
android.os.Handler.dispatchMessage(Handler.java:99)
01-30 11:26:22.959: E/FMTN(20460):  at android.os.Looper.loop(Looper.java:130)
01-30 11:26:22.959: E/FMTN(20460):  at 
android.os.HandlerThread.run(HandlerThread.java:60)
01-30 11:26:22.959: E/FMTN(20460): Caused by: 
java.lang.IllegalArgumentException: size <= 0
01-30 11:26:22.959: E/FMTN(20460):  at 
java.io.BufferedInputStream.<init>(BufferedInputStream.java:92)
01-30 11:26:22.959: E/FMTN(20460):  at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:251)
01-30 11:26:22.959: E/FMTN(20460):  at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118)

01-30 11:26:22.959: E/FMTN(20460): Caused by: 
java.lang.IllegalArgumentException: size <= 0

Original issue reported on code.google.com by budaevav on 30 Jan 2014 at 7:28

GoogleCodeExporter commented 9 years ago
I'am analyze my problem. Exception created in method HttpTransportSE.call on 
code like this:

if (status != 200) {
        throw new HttpResponseException("HTTP request failed, HTTP status: " + status, status);
      }
      InputStream is;
      if (gZippedContent) {
        is = getUnZippedInputStream(new BufferedInputStream(connection.openInputStream(), contentLength));
      } else {
        is = new BufferedInputStream(connection.openInputStream(), contentLength);
      }
    }
    catch (IOException e)
    {
      InputStream is;
      if (gZippedContent) {
        is = getUnZippedInputStream(new BufferedInputStream(connection.getErrorStream(), contentLength));

on server response header ContentLenght = 0, http response code = 413, then  is 
= getUnZippedInputStream(new BufferedInputStream(connection.openInputStream(), 
contentLength)); throw IllegalArgumentException - if size <= 0.

Please check ContentLenght before create and read Buffer.

Original comment by budaevav on 30 Jan 2014 at 9:45

GoogleCodeExporter commented 9 years ago
Ksoap v3.1.1

Original comment by budaevav on 30 Jan 2014 at 10:00

GoogleCodeExporter commented 9 years ago
I committed a potential fix to master. Can you test it out? 

Original comment by mosa...@gmail.com on 30 Jan 2014 at 5:35

GoogleCodeExporter commented 9 years ago
Yes. Where i can download bild or source to check it?

Original comment by budaevav on 31 Jan 2014 at 7:32

GoogleCodeExporter commented 9 years ago
https://code.google.com/p/ksoap2-android/wiki/SourceCodeHosting?tm=4

Original comment by mosa...@gmail.com on 14 Feb 2014 at 5:14