2
I am using the lib Ksoap2 in the Android project, for communication with webservice.
All communication is within an Asynctask().
In some moments of access to the method, an Exception occurs:
"java.io.Eofexception"
I did an Internet search and was recommended to include the property "Connection/close":
[source] https://groups.google.com/forum/#! msg/ksoap2-android/nwx0MCo4js4/Fyjsxweiekqj
But even adding, sometimes the error reappears:
HttpTransportSE transport = new HttpTransportSE(WSBase.URL);
try {
transport.getServiceConnection().setRequestProperty("Connection", "close");
transport.debug = true;
transport.call(SOAP_ACTION + methodName, envelope);
SoapObject response = (SoapObject) envelope.getResponse();
return new WsRetorno(Integer.parseInt(response.getPropertyAsString("retXml").toString()),
response.getPropertyAsString("desRet").toString());
} catch (Exception e) {
return new WsRetorno(-1, e.getMessage());
}
Someone who’s been through it knows why and how to fix it?