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 6723215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:32:33+00:00 2026-05-26T09:32:33+00:00

I’m using KSoap to acess .net webservice from my android programme. When the webservice

  • 0

I’m using KSoap to acess .net webservice from my android programme. When the webservice is either down or webservice url is wrong my application crashes.

Can someone tell me a way to handle this issue.

My code goes as below

public String logOut(String prefURL){
String Desc = "logging out";


String NAMESPACE="http://tempuri.org/";
String METHOD_NAME = "Logout";
String SOAP_ACTION = "http://tempuri.org/Logout";
String URL = prefURL+"/Authentication.asmx";

//creating soap object
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);

//adding properties to Request Soap Object
Request.addProperty("resourceID", ResourceID);
Request.addProperty("organisationID", OrganisatoinID);
Request.addProperty("description", Desc);
Request.addProperty("sessionID", SessionID);
Request.addProperty("imei", LoginActivity.deviceid);
Request.addProperty("longtitude", String.valueOf(LoginActivity.RDMSLon));
Request.addProperty("langtitude", String.valueOf(LoginActivity.RDMSLat));
Request.addProperty("deviceType", 4);

//creating soap envelop
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(Request);

//creating transport object
AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);

            try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive resultString = (SoapPrimitive)envelope.getResponse();

//jason array stored into a string
jstringarray = String.valueOf(resultString);
Log.v(TAG, "Logout" + jstringarray);

jArray = new JSONArray(String.valueOf(jstringarray));
JSONObject json_data = null;
json_data = jArray.getJSONObject(0);
Status = json_data.getString("Status");
Log.v(TAG, "Logout: "+ Status);


            } catch (IOException e) {
    e.printStackTrace();
            } catch (XmlPullParserException e) {
    e.printStackTrace();
            } catch (JSONException e) {

    e.printStackTrace();
            }    

    return Status;
}

logcat extract

10-26 16:39:39.174: V/Login2(791): Inside preexecute
10-26 16:39:40.204: W/System.err(791): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <HTML>@1:6 in java.io.InputStreamReader@44f1f8e8) 
10-26 16:39:40.248: W/System.err(791):  at org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
10-26 16:39:40.254: W/System.err(791):  at org.kxml2.io.KXmlParser.require(KXmlParser.java:1431)
10-26 16:39:40.254: W/System.err(791):  at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:127)
10-26 16:39:40.254: W/System.err(791):  at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
10-26 16:39:40.254: W/System.err(791):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
10-26 16:39:40.254: W/System.err(791):  at com.eyepax.rdms.service.ValidateUser.validate(ValidateUser.java:69)
10-26 16:39:40.254: W/System.err(791):  at com.eyepax.rdms.LoginActivity$LoginTask.doInBackground(LoginActivity.java:434)
10-26 16:39:40.265: W/System.err(791):  at com.eyepax.rdms.LoginActivity$LoginTask.doInBackground(LoginActivity.java:1)
10-26 16:39:40.265: W/System.err(791):  at android.os.AsyncTask$2.call(AsyncTask.java:185)
10-26 16:39:40.265: W/System.err(791):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-26 16:39:40.265: W/System.err(791):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-26 16:39:40.265: W/System.err(791):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
10-26 16:39:40.265: W/System.err(791):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
10-26 16:39:40.265: W/System.err(791):  at java.lang.Thread.run(Thread.java:1096)
10-26 16:39:40.265: V/validate_user(791): Excepion
10-26 16:39:40.265: V/Login2(791): Inside doingback
10-26 16:39:40.265: V/Login2(791): Inside onPost
10-26 16:39:40.265: D/AndroidRuntime(791): Shutting down VM
10-26 16:39:40.265: W/dalvikvm(791): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-26 16:39:40.284: E/AndroidRuntime(791): FATAL EXCEPTION: main
10-26 16:39:40.284: E/AndroidRuntime(791): java.lang.NullPointerException
10-26 16:39:40.284: E/AndroidRuntime(791):  at com.eyepax.rdms.LoginActivity$LoginTask.onPostExecute(LoginActivity.java:443)
10-26 16:39:40.284: E/AndroidRuntime(791):  at com.eyepax.rdms.LoginActivity$LoginTask.onPostExecute(LoginActivity.java:1)
10-26 16:39:40.284: E/AndroidRuntime(791):  at android.os.AsyncTask.finish(AsyncTask.java:417)
10-26 16:39:40.284: E/AndroidRuntime(791):  at android.os.AsyncTask.access$300(AsyncTask.java:127)
10-26 16:39:40.284: E/AndroidRuntime(791):  at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
10-26 16:39:40.284: E/AndroidRuntime(791):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-26 16:39:40.284: E/AndroidRuntime(791):  at android.os.Looper.loop(Looper.java:123)
10-26 16:39:40.284: E/AndroidRuntime(791):  at android.app.ActivityThread.main(ActivityThread.java:4627)
10-26 16:39:40.284: E/AndroidRuntime(791):  at java.lang.reflect.Method.invokeNative(Native Method)
10-26 16:39:40.284: E/AndroidRuntime(791):  at java.lang.reflect.Method.invoke(Method.java:521)
10-26 16:39:40.284: E/AndroidRuntime(791):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-26 16:39:40.284: E/AndroidRuntime(791):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-26 16:39:40.284: E/AndroidRuntime(791):  at dalvik.system.NativeStart.main(Native Method)

Thanks in advance.

  • 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-05-26T09:32:34+00:00Added an answer on May 26, 2026 at 9:32 am

    Figured out the issue. When exception occured there are no message to be returned to main thread. I added a string value “failed” inside excepton block I added a value to the variable. so no more null pointer.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.