没搞过,我都是调用ashx,把数据变成json格式

解决方案 »

  1.   


    SoapObject result = (SoapObject) envelope.bodyIn;
    SoapObject detail = (SoapObject) result.getProperty(METHOD_NAME);
    for (int i = 0; i < detail.getPropertyCount(); i++) {
     
                      SoapObject mstr = (SoapObject) detail.getProperty(i);
                       
                      String str_result  = mstr .getProperty(0).toString();
                       list.add(str_result); //这个你要的
      }
      

  2.   

    你可以试着用这个解析
    public List<Map<String, Object>> jsonToArray(String json) {
    List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
    try {
    JSONObject jsonobj = new JSONObject(json);
    JSONArray ary = jsonobj.getJSONArray("result");
    for (int i = 0; i < ary.length(); i++) {
    JSONObject obj = (JSONObject) ary.opt(i);
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("rid", obj.getString("rid"));
    map.put("name", obj.getString("name"));
    map.put("wk", obj.getString("wk"));
    map.put("wboxoffice", obj.getString("wboxoffice"));
    map.put("tboxoffice", obj.getString("tboxoffice"));
    list.add(map);
    }
    } catch (JSONException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    return list;
    }