HttpTransportSE.call sometimes raises a java.io.EOFException

3,238 views
Skip to first unread message

Paul Brogan

unread,
Nov 3, 2013, 8:10:10 PM11/3/13
to ksoap2-...@googlegroups.com
Hi All,


I am sending data to an IIS7.5  .net 3.5 web service.

Sometimes it works fine, and then other times it does not work, and gives me the following error after I call aHTTP.call(SOAP_ACTION, aSoapEnvelope);


HttpTransportSE aHTTP = new HttpTransportSE(MiscFunctions.mURL,MiscFunctions.mhttpsTimeOut);
aHTTP.debug = true;
aHTTP.call(SOAP_ACTION, aSoapEnvelope);


11-04 13:56:03.045: W/System.err(4179): java.io.EOFException
11-04 13:56:03.045: W/System.err(4179):  at libcore.io.Streams.readAsciiLine(Streams.java:203)
11-04 13:56:03.045: W/System.err(4179):  at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
11-04 13:56:03.045: W/System.err(4179):  at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
11-04 13:56:03.045: W/System.err(4179):  at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
11-04 13:56:03.045: W/System.err(4179):  at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
11-04 13:56:03.045: W/System.err(4179):  at org.ksoap2.transport.ServiceConnectionSE.getResponseCode(ServiceConnectionSE.java:103)
11-04 13:56:03.045: W/System.err(4179):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:197)


I have done some googling around and found something about headers being required, or System.setProperty("http.keepAlive", "false");

Any help or advise is greatly appreciated.

thanks
p.

Paul Brogan

unread,
Nov 4, 2013, 5:48:52 PM11/4/13
to ksoap2-...@googlegroups.com

Sorry, 

 

I forgot to mention it works fine in version ksoap2-android-assembly-3.0.0-jar-with-dependencies. I have been using it for months.

 

I updated to ksoap2-android-assembly-3.1.0-jar-with-dependencies and the issue started occurring.

 

I have since rolled back to ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar and it is fine again.

 

[Perhaps I am not using the latest version correctly.]

 

p.

 



--
You received this message because you are subscribed to a topic in the Google Groups "ksoap2-android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ksoap2-android/nwx0MCo4js4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ksoap2-androi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Manfred Moser

unread,
Nov 4, 2013, 6:13:23 PM11/4/13
to ksoap2-...@googlegroups.com
The keep alive header used to be hardcoded to be always there.. and with 3.1. it got removed since it caused issues for many users.. 




--
You received this message because you are subscribed to the Google Groups "ksoap2-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ksoap2-androi...@googlegroups.com.

Alex N

unread,
Feb 26, 2014, 3:23:05 AM2/26/14
to ksoap2-...@googlegroups.com


Am Dienstag, 5. November 2013 00:13:23 UTC+1 schrieb Manfred Moser:
The keep alive header used to be hardcoded to be always there.. and with 3.1. it got removed since it caused issues for many users.. 

Do you have a workaround to solve this problem?
I need versions 3.1.0 or newer because i need the Soapfault parsing for HTTP 500 response code.

Greetz
Alex

Paul Brogan

unread,
Feb 26, 2014, 3:07:00 PM2/26/14
to ksoap2-...@googlegroups.com
Hi,

this works for me:

if if (UseHTTPS) {
aHTTP = new KeepAliveHttpsTransportSE(mHttpsServerURL, mHttpsPort, mServiceFile, mhttpsTimeOutUpload);
} else 
{
aHTTP = new HttpTransportSE(mURL);
aHTTP.getServiceConnection().setRequestProperty("Connection", "close");
}



If you need the keep alive header you could try adding the property back in using something like below.

aHTTP.getServiceConnection().setRequestProperty("KeepAlive","false");// true?


I hope that helps,

Paul.



--
You received this message because you are subscribed to a topic in the Google Groups "ksoap2-android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ksoap2-android/nwx0MCo4js4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ksoap2-androi...@googlegroups.com.
Message has been deleted

Alex N

unread,
Feb 28, 2014, 7:25:10 AM2/28/14
to ksoap2-...@googlegroups.com


Am Mittwoch, 26. Februar 2014 21:07:00 UTC+1 schrieb Paul Brogan:
if if (UseHTTPS) {
aHTTP = new KeepAliveHttpsTransportSE(mHttpsServerURL, mHttpsPort, mServiceFile, mhttpsTimeOutUpload);
} else 
{
aHTTP = new HttpTransportSE(mURL);
aHTTP.getServiceConnection().setRequestProperty("Connection", "close");
}



If you need the keep alive header you could try adding the property back in using something like below.

aHTTP.getServiceConnection().setRequestProperty("KeepAlive","false");// true?


Unfortunately this help me not :(
Oddly the problem occurs on new Android version 4.x (Samsung S3, Samsung Galaxy Nexus, LG Nexus 4) - on an old android 2.2 (Samsung GT-I5800) the app is runnig without this problem.
The question is: is this a problem with the new versions?
Another idea: could this a problem with the energy savings on the wifi connection?

Greetz
Alex

Paul Brogan

unread,
Feb 28, 2014, 4:38:33 PM2/28/14
to ksoap2-...@googlegroups.com
I had an issue with a certain model of vodafone ADSL/WiFi router.
It couldn't do outbound HTTPS connections from the phone using WiFi.


Try and change your router to a different make and model and retest.




--

Hong

unread,
Mar 6, 2014, 4:04:52 PM3/6/14
to ksoap2-...@googlegroups.com
Thanks a lot, Paul, for the information.  I could see me wasting hours looking into this without knowing what you have found out.

I have rolled back to 3.0.0 from 3.2.0, and everything is fine.  I do not have any reason to upgrade to 3.2.0. at this point of time.

Hong

namratha santhosh

unread,
Mar 10, 2014, 4:01:32 AM3/10/14
to ksoap2-...@googlegroups.com
Hi  All,
In order solve this problem of EOFException, I am using

CustomHttpTransportSE.java class instead of HttpTransportSE.java due to my proj requirement. Include

connection.setRequestProperty(

"Connection", "close"); along with other properties.

I have tested it on ksoap2-android-assembly-3.1.1-jar-with-dependencies.jar it works fine.

 

Thanks,

Android developer

Reply all
Reply to author
Forward
0 new messages