android端webservice解决方案-Ksoap2获取数据解析

漆雕硕
2023-12-01
// 获取返回的数据
		SoapObject object = (SoapObject) envelope.bodyIn;
		// 获取返回的结果
		Model model = new Model();//Model有month、store、total三个属性
		List<Model> list = new ArrayList<Model>();
		int count = object.getPropertyCount();//获取结果个数
		for(int i=0;i<object.getPropertyCount();i++){
			SoapObject subObject =  (SoapObject) object.getProperty(i);
			String month = subObject.getPropertyAsString("month");
			model.setMonth(Integer.parseInt(subObject.getPropertyAsString("month")));
			model.setStore(store);
			model.setTotal(Float.parseFloat(subObject.getPropertyAsString("total")));
			list.add(model);
		}

 类似资料: