新手开发android的demo,遇到一个问题,android调用java的webservice,取到记录数,但是anytype{}里都是空的,搞了一整天了,求解答。。。。
public void getlist(){
String nameSpace = "http://billlist.dcdz.com/";
String methodName = "getList";
String endPoint = "http://192.168.1.106:8080/TheService/BillListPort";
String soapAction = "http://billlist.dcdz.com/getList";
SoapObject rpc = new SoapObject(nameSpace, methodName);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
envelope.bodyOut = rpc;
envelope.setOutputSoapObject(rpc);
HttpTransportSE transport = new HttpTransportSE(endPoint);
transport.debug=true;
SoapObject object;
try {
// 调用WebService
transport.call(soapAction, envelope);
} catch (Exception e) {
e.printStackTrace();
}
try {
object = (SoapObject) envelope.bodyIn;
int count = object.getPropertyCount();
// 得到服务器传回的数据
int count1 = object.getPropertyCount();
if(count1>0)
{
for (int i = 1; i < count1; i++) {
HashMap listItem = new HashMap();
SoapObject soapProvince = (SoapObject)object.getProperty(i);
listItem.put("userid", soapProvince.getProperty("userid").toString());
listItem.put("username", soapProvince.getProperty("username").toString());
listItem.put("usetime", soapProvince.getProperty("usetime").toString());
list.add(listItem);
}}
} catch (Exception e) {
e.printStackTrace();
}
![图片说明](https://img-ask.csdn.net/upload/201606/29/1467188342_923411.png)