Note that there are some explanatory texts on larger screens.

plurals
  1. POksoap2 error with android studio
    primarykey
    data
    text
    <p>I have imported a project from eclipse into android studio. The project used to work fine with Eclipse.</p> <p>I am using SOAP to communicate my android app with my server with php. the library that i am using is <strong>ksoap2-android-assembly-2.6.4-jar-with-dependencies.jar</strong></p> <p>The app crashed when the app tries to call a class from the library.</p> <p>1) here i put the method of my conection and returns a jSON ARRAY.</p> <pre><code>import android.util.Log; import motelalpaso.datos.Config; import org.json.JSONArray; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; public class ConexionSoap { public static JSONArray get_json_array(String method, String[]... params){ JSONArray array = new JSONArray(); SoapObject result = null; SoapObject request = new SoapObject(Config.NAMESPACE, method); for(int i = 0; i &lt; params.length; i++){ request.addProperty(params[i][0], params[i][1]); } SoapSerializationEnvelope envelope = newSoapSerializationEnvelope(SoapEnvelope.VER12); envelope.dotNet = false; try{ envelope.setOutputSoapObject(request); HttpTransportSE transporte = new HttpTransportSE(Config.URL);transporte.call(Config.NAMESPACE + "/" + method, envelope);Log.d("try", "Llego hasta aqui"); result = (SoapObject) envelope.bodyIn; array = new JSONArray(result.getProperty(1).toString()); }catch(Exception e){ Log.d("Error", e.getMessage()); } return array; } } </code></pre> <p>2) These are the parameters that contains the necessary for the communication.</p> <pre><code> public class Config { public static final String NAMESPACE = "http://www.motelalpaso.cl/webservice/android/"; public static final String BY_LOCATION = "obtener_por_location"; public static final String BY_NAME = "find_autos_by_namek"; public static final String URL = "http://www.motelalpaso.cl/webservice/android/moteles.php"; } </code></pre> <p>3) Finally the error what i got.. I hope you find what i am doing wrong.. </p> <pre><code>java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:200) at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274) at java.util.concurrent.FutureTask.setException(FutureTask.java:125) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) at java.lang.Thread.run(Thread.java:1019) Caused by: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject at motelalpaso.negocio.ConexionSoap.get_json_array(ConexionSoap.java:18) at motelalpaso.ui.BuscarNombre$1$1.doInBackground(BuscarNombre.java:55) at motelalpaso.ui.BuscarNombre$1$1.doInBackground(BuscarNombre.java:40) at android.os.AsyncTask$2.call(AsyncTask.java:185) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload