simpligility / ksoap2-android

ksoap2-android - SOAP support for Android
http://simpligility.github.io/ksoap2-android/
Other
544 stars 247 forks source link

Request SOAP response comes empty #136

Closed AlyssonPHN closed 4 years ago

AlyssonPHN commented 4 years ago

Version: 3.6.4 On request on Android onRestart sometimes SOAP response comes empty.

Requests work well, but sometimes when app inative or device gets locked, when returning to app, the request comes with empty value.

I debugged the web service and at this time the request didn't even reach the web service

`SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);

XMLOutputter xmOut = new XMLOutputter();

if (PARAMETRO != null) {
    Request.addProperty("sReq", xmOut.outputString(PARAMETRO));
}

SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(
        SoapEnvelope.VER11);

//soapEnvelope.dotNet = true;
soapEnvelope.dotNet = false;

soapEnvelope.setOutputSoapObject(Request);
Log.i("Requisicao", xmOut.outputString(PARAMETRO));
System.setProperty("http.keepAlive", "false");

HttpTransportSE aht = new HttpTransportSE(URL, 10000);
aht.call("\"\"", soapEnvelope);

// retorno = (SoapPrimitive)soapEnvelope.getResponse();
msg = soapEnvelope.getResponse();

msg = soapEnvelope.bodyIn;`

this is called within a thread.