Pregunta

amigos,

No veo solicitud de tiempo de espera en la biblioteca KSoap

guíame cualquiera ¿qué debo hacer? o desde donde descargar la última versión de la misma?

mi código

 SoapObject userRequest=new SoapObject(NAMESPACE, METHOD_NAME); 
                userRequest.addProperty("session_id", session_id ); 
                userRequest.addProperty("page_size", PageSize); 
                userRequest.addProperty("offset",Offset ); 


                SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
                request.addProperty("GetAlertsInput", userRequest); 


                SoapSerializationEnvelope envelope = new 
SoapSerializationEnvelope(SoapEnvelope.VER11); 
                envelope.bodyOut = request; 


                HttpTransportAndroid androidHttpTransport = new 
HttpTransportAndroid(URL); 


 androidHttpTransport.call(SOAP_ACTION_GETALERTS, envelope); 

cualquier ayuda se agradece.

¿Fue útil?

Solución

Could mention that I made a modification to the KSoap2 v2.5.2 to support timeout for HttpTransportSE class. It will throw a SocketTimeoutException when timeout occurs.

It's both jar and src is found at this url https://www.lightsoftai.com/?p=707

Otros consejos

I have more than one methods on the server . I am using the same line

androidHttpTransport.call(SOAP_ACTION_GETALERTS, envelope);

With different methods name, while getting second response its crashing.

STEP : 1 Get the ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar file. And place the jar file in app > libs folder.

STEP : 2 compile files('libs/ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar') place the line in build gradle > dependencies.

STEP :3 static int networkTimeOut = 60 * 1000;

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(inserttransaction_request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL, networkTimeOut);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top