java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive?

烈酒焚心 提交于 2019-12-04 10:10:06
crazydragon

because the type of your webservice return is String ,so you can solve it this way:

Object  response=  sse.getResponse();  

when your webservice return values type is byte[] ,you can do it

SoapObject response=(SoapObject)envelope.bodyIn;

May be your web service is returning an XML object which is causing ClassCastException at client's end as it is not supported by KSOAP, try returning result of your web service as a String(preferably with CDATA) and your problem would get solved.

kgiannakakis

This question will be helpful to you.

You need to use getString() to convert a returned property into a String:

item_code.setText(response.getProperty(6).toString());
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!