I'm using the KSoap2 lib 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 searched the Internet and was recommended to include the "Connection / close" property:
[source] link
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 has gone through this knows why and how to solve?