Android Parser from soapFault

Asked

Viewed 17 times

1

Well I’m starting to make errors that the webservice Soap returns to me, as for example if the user enters login or password wrong the web service returns an error Soapfault: user or password invalid. I just can’t get this message out and show it in Toast to warn about the problem. How could I solve this, why in java happens a Try catch Exception.

1 answer

1


I decided as follows, in the method where I call the Web Service to check the login I used the following check:

 if(envelope.bodyIn instanceof SoapFault) {
     strFault = ((SoapFault) envelope.bodyIn).faultstring

 }

And in the try catch where the method is called where the error of the Exception called a thread with a toast.

finally {
    runOnUiThread(new Runnable() {
        public void run() {
            Toast.makeText(getApplicationContext(), ws.strFault, Toast.LENGTH_SHORT).show();
        }
    });

    dialog.dismiss();
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.