webservice 返回了一个list,类型是自己定义的allUser,取值的时候取不到下面是取值的代码
try
{
se.call(soapAction, envelope);
SoapObject response = (SoapObject)envelope.getResponse();
if(response!=null){
request = (SoapObject) envelope.getResult();
String nickname = request.getProperty("pnickname").toString();
list.add(0, nickname);
String name = request.getProperty("name").toString();
list.add(1,name);
String telephone =request.getProperty("ptel").toString();
list.add(2,telephone);
String carNum = request.getProperty("pplatenum").toString();
list.add(3,carNum);
String driverNum = request.getProperty("pjobnum").toString();
list.add(4,driverNum);
String company = request.getProperty("pcompany").toString();
list.add(5,company);
String credit =request.getProperty("pcredit").toString();
list.add(6,credit);
String picture =request.getProperty("pimage").toString();
list.add(7,picture);
}
} catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
运行时不报错,接收的list是空,该怎么解决
Android Web服务
------解决方案--------------------
首先不知道你是怎么传输的,是用的xml还是jonStr?但是一般过程是,接受到webservice传输过来的数据,要进行解析,然后获得List<类名>。