Manick
Manick

Reputation: 857

Issues while consuming webservice

Installing Apache Tomcat, Apache Axis2, Create web project, Convert to service, Deploy it in Tomcat, Create client project then, Create client with stub of our services and finally, access the service.

I think these are all the steps to consume web service on Android Eclipse.
Here I have completed up to the step deploying the web project on tomcat server, it shown about the services successfully, but server option shown up as SYNCHRONIZED. It's given below

server

Tomcat v6.0 server at localhost[Started,Synchronized]

AndBack[Synchronized].


Meanwhile after creating client project it shown up during run time as:

Sorry! The application has stopped unexpectedly. Please try again. Force close

Please refer my logcat given below.

LOGCAT

04-25 16:46:51.153: E/dalvikvm(273): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method org.test.Frontend.AndFrontActivity.onCreate
04-25 16:46:51.153: W/dalvikvm(273): VFY: unable to resolve new-instance 25 (Lorg/ksoap2/serialization/SoapObject;) in Lorg/test/Frontend/AndFrontActivity;
04-25 16:46:51.153: D/dalvikvm(273): VFY: replacing opcode 0x22 at 0x0010
04-25 16:46:51.164: D/dalvikvm(273): VFY: dead code 0x0012-0081 in Lorg/test/Frontend/AndFrontActivity;.onCreate (Landroid/os/Bundle;)V
04-25 16:46:51.243: D/AndroidRuntime(273): Shutting down VM
04-25 16:46:51.243: W/dalvikvm(273): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
04-25 16:46:51.273: E/AndroidRuntime(273): FATAL EXCEPTION: main
04-25 16:46:51.273: E/AndroidRuntime(273): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
04-25 16:46:51.273: E/AndroidRuntime(273):  at org.test.Frontend.AndFrontActivity.onCreate(AndFrontActivity.java:28)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.os.Looper.loop(Looper.java:123)
04-25 16:46:51.273: E/AndroidRuntime(273):  at android.app.ActivityThread.main(ActivityThread.java:4627)
04-25 16:46:51.273: E/AndroidRuntime(273):  at java.lang.reflect.Method.invokeNative(Native Method)
04-25 16:46:51.273: E/AndroidRuntime(273):  at java.lang.reflect.Method.invoke(Method.java:521)
04-25 16:46:51.273: E/AndroidRuntime(273):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-25 16:46:51.273: E/AndroidRuntime(273):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-25 16:46:51.273: E/AndroidRuntime(273):  at dalvik.system.NativeStart.main(Native Method)

Upvotes: 0

Views: 225

Answers (1)

oikonomopo
oikonomopo

Reputation: 4065

Turns out external jars such as

ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar

to be put under /libs folder so Eclipse ADT automatically adds your jars to the buildpath of your application. It was a buildpath missing defined class error after all.. I hope this will help you, too!

here or there

Upvotes: 1

Related Questions