Skip to content
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

Exception when call web service method #181

Open
GoogleCodeExporter opened this issue Jun 17, 2015 · 5 comments
Open

Exception when call web service method #181

GoogleCodeExporter opened this issue Jun 17, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

Ksoap v3.1.1

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Yes. Where i can download bild or source to check it?

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

@GoogleCodeExporter
Copy link
Author

https://code.google.com/p/ksoap2-android/wiki/SourceCodeHosting?tm=4

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant