niuxdexiaobai / ksoap2-android

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

java.io.IOException: Stream is closed #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Sry I can't tell you. A user reported that on his Galaxy S he gets this 
Exception and only for one part of the app which uses ksoap2.
I can't reproduce it myselve.

What is the expected output? What do you see instead?
It should return success and give me result body but I get this Exception:
java.io.IOException: Stream is closed
at java.io.BufferedInputStream.read(BufferedInputStream.java:316)
at org.ksoap2.transport.HttpTransportSE.readDebug(HttpTransportSE.java:273)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:241)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:116)
at org.dwi.weinziele.api.DWIApi.soapRequest(DWIApi.java:81)
...

What version of the product are you using? On what operating system?
3.0.0 on Android 4.0 on Galaxy S

Please provide any additional information below.
This is my Code:
// Initialize soap request
SoapObject request = new SoapObject(getNamespace(), methodName);

// add parameters
if(properties!=null) {
    for(Map.Entry<String, Object> e : properties.entrySet()) {
        PropertyInfo propertyInfo = new PropertyInfo();
        propertyInfo.setName("n0:"+e.getKey());
        propertyInfo.setValue(e.getValue());
        propertyInfo.setType(e.getValue().getClass());
        request.addProperty(propertyInfo);
    }
}

// create envelope
SoapSerializationEnvelope envelope = new 
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
apiResult.envelope = envelope;

// initialize http-transport
HttpTransportSE androidHttpTransport = new HttpTransportSE(getUrl());
androidHttpTransport.debug = true;
apiResult.androidHttpTransport = androidHttpTransport;

// send request
apiResult.responseHeader = androidHttpTransport.call(soapAction, envelope, 
null);

Original issue reported on code.google.com by SigmaEps...@gmail.com on 18 Mar 2013 at 6:16

GoogleCodeExporter commented 9 years ago
Having the same problem here.

Original comment by rafaelno...@gmail.com on 19 Apr 2013 at 4:10

GoogleCodeExporter commented 9 years ago
I used to get this exception which got solved when i used K-SOAP 3.0.0 RC4

Original comment by rbhhere on 19 Apr 2013 at 8:50

GoogleCodeExporter commented 9 years ago
have the same issue

Original comment by ofe...@etoro.com on 1 May 2013 at 7:50

GoogleCodeExporter commented 9 years ago
It's not a problem of ksoap2-android. It's a well known android bug.
Just add this line before executing the request and the problem should be 
solved:
System.setProperty("http.keepAlive", "false");

Original comment by SigmaEps...@gmail.com on 1 May 2013 at 8:27

GoogleCodeExporter commented 9 years ago
this solution does not work for me

Original comment by dumoulin...@gmail.com on 2 May 2013 at 1:36

GoogleCodeExporter commented 9 years ago
should that be keepAlive = true or keepAlive=false?...i'm having the same issue 
using ksoap2  v3.0

Original comment by binomial...@gmail.com on 5 May 2013 at 7:46

GoogleCodeExporter commented 9 years ago
Thank you so much, totally fix this issue for me!
been looking for this solution for so long.

P.S i'm using ksoap v3.0RC and just added
System.setProperty("http.keepAlive", "false");

before making the call, like said in the original post

Original comment by ofe...@etoro.com on 9 May 2013 at 8:03

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 15 Oct 2013 at 3:46

GoogleCodeExporter commented 9 years ago
ok ,i find WHY.check your Variables WEB returned,if a variable not 
instantiated.the problem may be come up.

Original comment by xuqishen...@gmail.com on 9 Dec 2013 at 2:02

GoogleCodeExporter commented 9 years ago
i fixed this issue in the same way as #7 thanks very much

Original comment by hanguoxi...@gmail.com on 21 Mar 2014 at 1:47