Not able to access web-service in Android

Not been able to access the webservice with a kinds of Android. I am using Eclipse and ksoap2 library. I've tried all the codes circulating on the Internet. Where is the error I'm doing. I installed everything again, but it did not help.

Screenshot

Error Logs

08-25 11:32:51.872: E/Trace(972): error opening trace file: No such file or directory (2)

08-25 11:32:56.143: E/dalvikvm(972): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.knnklz.webservice04.MainActivity$2.run

08-25 11:32:56.193: E/AndroidRuntime(972): FATAL EXCEPTION: Thread-93

08-25 11:32:56.193: E/AndroidRuntime(972): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject

08-25 11:32:56.193: E/AndroidRuntime(972): at com.knnklz.webservice04.MainActivity$2.run(MainActivity.java:277)

Android Java Code

tx = (TextView)findViewById(R.id.textView1);            

            try {
                SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
                request.addProperty("Celsius", "85");
                SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

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


                androidHttpTransport.debug = true;
                androidHttpTransport.call(SOAP_ACTION, envelope);
                SoapPrimitive response = (SoapPrimitive) envelope.getResponse();

                tx.setText(response.toString());

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

Answers


There are only three reasons you will ever get this error:

  1. The class genuinely doesn't exist. If you are using code from an official example and getting this, make sure you have the latest build of the library
  2. You have not added the jar to your build path. To fix this, right click on the jar in Eclipse, and do Build Path ► Add to Build Path.
  3. Your jar is not in the /libs folder. This happens when you have added the jar to the build path, but newer versions of ADT need it to be in /libs. Put it there and re-add it to the build path.

Need Your Help

Convenience methods for resizable images

ios objective-c uiimage resizable

I've got a load of images that are resizable in my app and I use them all over the place.

how to tell whether a connection is established in java?

java android nio socketchannel

I tried to build a socket channel between two emulators in android. I wrote the following code:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.