Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9313791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:58:10+00:00 2026-06-19T01:58:10+00:00

Hey I’ve got this problem: In my Android App there’s a method that calls

  • 0

Hey I’ve got this problem:
In my Android App there’s a method that calls a web service using KSOAP. Unfortunately everytime I try to execute this specific method, the whole app crashes. That happens on the virtual as well as the real device.

I’ve tried to use this tutorial: http://sarangasl.blogspot.de/2011/10/android-web-service-access-tutorial.html

The needed files are imported, KSOAP is added, Eclipse isn’t displaying any errors, internet usage is added to Manifest file. The method is called within the XML layout file of a fragment using android:onClick=”TestyTest”

I actually have no clue why the app crashes.

private final String NAMESPACE = "http://www.webserviceX.NET/";
    private final String URL = "http://www.webservicex.net/ConvertWeight.asmx";
    private final String SOAP_ACTION = "http://www.webserviceX.NET/ConvertWeight";
    private final String METHOD_NAME = "ConvertWeight";

    public void TestyTest(View view)
    {
        TextView text1 = (TextView) findViewById(R.id.update_text);

        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 

        String weight = "3700";
        String fromUnit = "Grams";
        String toUnit = "Kilograms";

        PropertyInfo weightProp =new PropertyInfo();
        weightProp.setName("Weight");
        weightProp.setValue(weight);
        weightProp.setType(double.class);
        request.addProperty(weightProp);

        PropertyInfo fromProp =new PropertyInfo();
        fromProp.setName("FromUnit");
        fromProp.setValue(fromUnit);
        fromProp.setType(String.class);
        request.addProperty(fromProp);

        PropertyInfo toProp =new PropertyInfo();
        toProp.setName("ToUnit");
        toProp.setValue(toUnit);
        toProp.setType(String.class);
        request.addProperty(toProp);

        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

        try {
            androidHttpTransport.call(SOAP_ACTION, envelope);
            SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
            Log.i("myApp", response.toString());


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

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

In case this helps here the logcat file:

02-20 10:58:06.430: E/dalvikvm(3599): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.test.testy.MainActivity.TestyTest
02-20 10:58:06.430: W/dalvikvm(3599): VFY: unable to resolve new-instance 562 (Lorg/ksoap2/serialization/SoapObject;) in Lcom/test/testy/MainActivity;
02-20 10:58:06.430: D/dalvikvm(3599): VFY: replacing opcode 0x22 at 0x0009
02-20 10:58:06.440: D/dalvikvm(3599): DexOpt: unable to opt direct call 0x0dc6 at 0x0f in Lcom/test/testy/MainActivity;.TestyTest
02-20 10:58:06.440: D/dalvikvm(3599): DexOpt: unable to opt direct call 0x0dc2 at 0x1a in Lcom/test/testy/MainActivity;.TestyTest
02-20 10:58:06.440: D/dalvikvm(3599): DexOpt: unable to opt direct call 0x0dc2 at 0x2f in Lcom/test/testy/MainActivity;.TestyTest
02-20 10:58:06.440: D/dalvikvm(3599): DexOpt: unable to opt direct call 0x0dc2 at 0x44 in Lcom/test/testy/MainActivity;.TestyTest
02-20 10:58:06.440: D/dalvikvm(3599): DexOpt: unable to opt direct call 0x0dc9 at 0x5b in Lcom/test/testy/MainActivity;.TestyTest
02-20 10:58:06.440: I/dalvikvm(3599): DexOpt: unable to optimize instance field ref 0x0384 at 0x5f in Lcom/test/testy/MainActivity;.TestyTest
02-20 10:58:06.440: D/dalvikvm(3599): DexOpt: unable to opt direct call 0x0dcc at 0x68 in Lcom/test/testy/MainActivity;.TestyTest
02-20 10:58:06.560: D/libEGL(3599): loaded /system/lib/egl/libEGL_tegra.so
02-20 10:58:06.600: D/libEGL(3599): loaded /system/lib/egl/libGLESv1_CM_tegra.so
02-20 10:58:06.610: D/libEGL(3599): loaded /system/lib/egl/libGLESv2_tegra.so
02-20 10:58:06.640: D/OpenGLRenderer(3599): Enabling debug mode 0
02-20 10:58:06.860: E/SpannableStringBuilder(3599): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
02-20 10:58:06.860: E/SpannableStringBuilder(3599): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
02-20 10:58:06.880: E/SpannableStringBuilder(3599): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
02-20 10:58:06.880: E/SpannableStringBuilder(3599): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
02-20 10:58:06.910: D/dalvikvm(3599): GC_CONCURRENT freed 154K, 5% free 7631K/7972K, paused 2ms+11ms, total 34ms
02-20 10:58:15.530: D/AndroidRuntime(3599): Shutting down VM
02-20 10:58:15.530: W/dalvikvm(3599): threadid=1: thread exiting with uncaught exception (group=0x41274930)
02-20 10:58:15.540: E/AndroidRuntime(3599): FATAL EXCEPTION: main
02-20 10:58:15.540: E/AndroidRuntime(3599): java.lang.IllegalStateException: Could not execute method of the activity
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.view.View$1.onClick(View.java:3597)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.view.View.performClick(View.java:4202)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.view.View$PerformClick.run(View.java:17340)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.os.Handler.handleCallback(Handler.java:725)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.os.Handler.dispatchMessage(Handler.java:92)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.os.Looper.loop(Looper.java:137)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.app.ActivityThread.main(ActivityThread.java:5039)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at java.lang.reflect.Method.invokeNative(Native Method)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at java.lang.reflect.Method.invoke(Method.java:511)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at dalvik.system.NativeStart.main(Native Method)
02-20 10:58:15.540: E/AndroidRuntime(3599): Caused by: java.lang.reflect.InvocationTargetException
02-20 10:58:15.540: E/AndroidRuntime(3599):     at java.lang.reflect.Method.invokeNative(Native Method)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at java.lang.reflect.Method.invoke(Method.java:511)
02-20 10:58:15.540: E/AndroidRuntime(3599):     at android.view.View$1.onClick(View.java:3592)
02-20 10:58:15.540: E/AndroidRuntime(3599):     ... 11 more
02-20 10:58:15.540: E/AndroidRuntime(3599): Caused by: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
02-20 10:58:15.540: E/AndroidRuntime(3599):     at com.test.testy.MainActivity.TestyTest(MainActivity.java:269)
02-20 10:58:15.540: E/AndroidRuntime(3599):     ... 14 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:58:11+00:00Added an answer on June 19, 2026 at 1:58 am

    No clue? The stack trace tells you:

    Caused by: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
    

    Find the JAR that contains that class and put it in your CLASSPATH.

    NoClassDefFoundError has a meaning that’s distinct from ClassNotFoundException:

    NoClassDefFoundError for code in an Java library on Android

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys i have a problem. There is an application that i built using
hey guys having this really simple problem but cant seem to figure out have
Hey there, Now im working this base on dmitko tutorial on extending django-registration post
Hey bloggers out there! I've created Wordpress blog that I am hosting myself, and
Hey guys! I have this little problem: I have one ViewController which adds 2
Hey, I'm currently trying to send an image file to a web server using
Hey I'm having a problem trying to figure this out: Lets start out with
Hey I'm using a HashMap to keep track of services and service-requests on a
Hey guys, I got the same error when I was using kiwi to install
hey i got a contnet type that i made and i want to twweak

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.