About Android using KSOAP2 caused By:java.lang.ClassCastException:org.ksoap2.SoapFault cannot is cast to Org.ksoap2.serialization.SoapObject

Source: Internet
Author: User
Tags set time

Caused By:java.lang.ClassCastException:org.ksoap2.SoapFault cannot is cast to Org.ksoap2.serialization.SoapObject

It bothered me for a long time to report such a similar mistake. The occasional newspaper is not always reported.

It turns out to be a little less judgmental, because the server is not necessarily the result we want to return each time.

See figure

Puzzled for a long time, finally in the StackOverflow inside only to find the answer.

Probably is the server abnormal time will cause this, no wonder my program will crash some time, such as a place should be passed an int type, the client side is not detected strictly, and then directly to the interface to go, this time the server side if not do detection, such as direct int.parse ("string"), Error or extreme point, the interface of the database account password deliberately dropped will trigger this exception.

A headache for a long time this problem

Incidentally, KSOAP2, can set the timeout, see a lot of other people's code is not set time-out, once the server gives the results longer, it will be abnormal. So let's set a time-out. Can't stand the program with the use of the crash ...

About Android using KSOAP2 caused By:java.lang.ClassCastException:org.ksoap2.SoapFault cannot is cast to Org.ksoap2.serialization.SoapObject

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.