1
When the server or service (IIS) is off, The web-service response time that there is some connection failure is very long. At this time the application (Android) requests closure due to inactivity. Have to decrease 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;
}
I have already found the solution, which by the way is very simple. It was a lack of looking a little more or using the right terms. Just pass as argument a value in milliseconds on the line
HttpTransportSE androidHttpTransport = new HttpTransportSE(urlFinal, 5000)
;– raphaRezzi
For the question to be in the accepted standards within Sopt, please follow the steps: remove the "SOLVED" part of the title, put your comment as an answer and mark as a solution the answer you put.
– Gustavo Cinque
Rapha, I removed the "solved" from the title and posted your comment as a response (in wiki mode), if you want to publish a reply, let me know and delete what I posted.
– brasofilo
Tranquil @brasofilo! I just didn’t know how to proceed. Thanks.
– raphaRezzi