When the server or service (IIS) is off , the web-service response time that there is some connection failure is too long. At that time the application (Android) requests the closure due to inactivity. Can you reduce this time or otherwise treat a possible exception?
public String getTesteConexao(){
String returns = "";
try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME_GET_TESTE_CONEXAO);
request.addProperty("senha", TAG_CHAVE);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(urlFinal);
androidHttpTransport.call(SOAP_ACTION, envelope);
returns = (String) envelope.getResponse();
} catch (Exception e) {
e.printStackTrace();
return "Exception: " + e.getMessage() + "\nCause: " + e.getCause();
}
return returns;
}