public static UserFriendListContainer getFriendList(SoapObject wizardobject)//TESTED
{
UserFriendListContainer container= new UserFriendListContainer();
List<UserFriendListModel> list= new ArrayList();
String currobj= wizardobject.getProperty("FriendListResult").toString();
Log.v("CurrentObjet+++++++",currobj.toString());
container.setParserResult(currobj);
SoapObject result = (SoapObject)wizardobject;
for(int i=0;i<result.getPropertyCount();i++)
{
SoapObject object = (SoapObject)wizardobject.getProperty(i);//here it is break
Log.v("result:::::",result.toString());
Log.v("obj:::::",object.toString());
Log.v("friendID",object.getProperty("friendid").toString());
String friendID=object.getProperty("friendid").toString();
Log.v("friendname",object.getProperty("friendname").toString());
String friendname=object.getProperty("friendname").toString();
Log.v("lastaction",object.getProperty("lastaction").toString());
String lastaction=object.getProperty("lastaction").toString();
Log.v("friendphoto",object.getProperty("friendphoto").toString());
String friendphoto=object.getProperty("friendphoto").toString();
UserFriendListModel model=new UserFriendListModel();
model.setfriendID(friendID);
model.setfriendName(friendname);
model.setfriendPhoto(friendphoto);
model.setLastAction(lastaction);
list.add(model);
}
container.setList(list);
return container;
}
}
-----
<message name="FriendListRequest"/>
<message name="FriendListResponse">
<part name="FriendListResult" type="tns:FirendListArray"/>
</message>
我来自webservice的xml部分就是那个。我试图通过解析来访问我的好友列表。我无法理解..当我调试它时它打破了“SoapObject object =(SoapObject)wizardobject.getProperty(i)”..我想知道如何我可以解析一个我从 web 服务中获取的列表吗?谢谢您提前提供的帮助...