Search code examples
c#web-servicesandroid-ksoap2

Error in application when run from any server except localhost


Struck with this since many days.

I have made an android app for my company in android where webservices are made in c#.

I use ksoap2 ver11 webservices still it gives me an expected start_tag error when I use it on another server other than localhost.

My webservices are hosted perfectly by my company's server but it gives this expected start tag error in Android 2.2 emulator.

And when i run it on my phone, it displays nothing (null error) in toast. I am not sure but it can be the 'NetworkOnMainThread' exception in phone(Android 4.0).

But what to do with the error in emulator?

I tried every possible thing any guesses what to do next to make the app working on phone?

Can anyone guide me whats wrong.

PS: It runs perfectly on localhost and my company has proxy.


Solution

  • I solved this error. :)

    For the emulator, the expected start tag error occurred because the URL was not parsed properly. Thats a common error.

    Secondly, In my manifest file, I had set the target SDK version to

    android:targetSdkVersion="16"

    instead of

    android:targetSdkVersion="8"

    So, it didn't run on my icecream sandwich. And it ran perfectly in emulator because I was testing on 2.2 emulator itself.

    To conclude, TargetVersion should be kept minimum, ideally 8 (2.2-Froyo) so it can run on all the devices.

    The error sounds stupid but I wasted two weeks for this. So, I hope others may not have to waste their precious time for such an error.