Search code examples
javaandroid.netweb-servicesksoap2

Ksoap and HttpTransport Seand AndroidHttpTransport Method Call


In this example code, I have a reference to ksoap2-android-assembly-2.6.3-jar-with-dependencies its incredible when do I arrive to the line hts.call(SOAP_ACTION, envelope); in debug mode; the application code ended with an error message into the Log Cat message error is :

-- 04-28 23:24:03.454: W/ActivityManager(80): Launch timeout has expired, giving up wake lock!
-- 04-28 23:23:38.667: W/ActivityManager(80): Activity idle timeout for ActivityRecord{407c0c10 yservices.screens/.MyservicesActivity}

My source code in the create event:

TextView tv = new TextView(this);
setContentView(tv);

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
AndroidHttpTransport hts = new AndroidHttpTransport(URL);
try {

    hts.call(SOAP_ACTION, envelope);

    SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
    // Log.i("myApp", response.toString());

    //tv.setText(weight+" "+fromUnit+" equal "+response.toString()+ " "+toUnit);
    tv.setText("Ok");

} catch(Exception e) {
    //e.getLocalizedMessage();
    tv.setText(e.getMessage());
}

I hope can you help me. My OS Version is Windows 7 64 Bit, Eclipse Indigo and JDK 1.6 if you need other information, write me.

Thanks


Solution

  • My Error Was because the ksoap2 need has reference in a folder named libs and not into a builder path eclipse, last android version to windows 7 x64 has problem with last version ksoap2