SoapObject result = (SoapObject) envelope.bodyIn;  
        //detail = (SoapObject) result.getProperty(METHOD_NAME);  
        Log.d(LogInfo, result.toString());
打印的result.toString()是getVersion1Response{out=anyType{IPRFolder=anyType{folderName=ipr_txt; folderVersion=1; }; }; }
传过来的List是List<IPRFolder> 里面有两个变量folderName,folderVersion

解决方案 »

  1.   

     SoapObject soapObject = (SoapObject) envelope.getResponse(); 
                      //如果获取的是个集合,就对它进行下面的操作
                      if(soapObject.getName()=="anyType")
                      {
                       //遍历Web Service获得的集合
                      for(int i=0;i<soapObject.getPropertyCount();i++){
                       
                       MFirst m=new MFirst();
                     
                       //获取单条的数据
                       SoapObject soapChilds =(SoapObject)soapObject.getProperty(i);
                       
                       //对单个的数据进行再次遍历,把它的每行数据读取出来
                       for(int k=0;k<soapChilds.getPropertyCount();k++)
                       {
                       PropertyInfo propertyInfo=new PropertyInfo();
                       soapChilds.getPropertyInfo(k, propertyInfo);
                      //获取实体类的所有属性
                       Field[] field = m.getClass().getDeclaredFields();  
                      //遍历所有属性
                           for(int j=0 ; j<field.length ; j++){     
                          //获取属性的名字
                                  String name = field[j].getName();    
                                 
                                  //把每个属性的名字跟Web Service返回的k行进行对比
                                  String ppinfoname=propertyInfo.getName().toLowerCase();
                               if(ppinfoname.equals(name.toLowerCase()))
                               {              
                                //调用个我也看不懂的方法,给实体类赋值,具体意思也不明白,资料就这样。
                               GetSetManager.setFieldValue(m,name,field[j].getType(),
                               soapChilds.getProperty(propertyInfo.getName()).toString());
                                 }
                              }
                       }
                     
                       list.add(m);
                      }
                      }
      

  2.   

     public static void setFieldValue(Object target, String fname, Class ftype,   
                Object fvalue) { //设置字段值  如:username 字段,setUsername(String username)
            if (target == null  
                    || fname == null  
                    || "".equals(fname)  
                    || (fvalue != null && !ftype.isAssignableFrom(fvalue.getClass()))) {//如果类型不匹配,直接退出 
                return;   
            }   
            Class clazz = target.getClass();   
            try {  //先通过setXxx()方法设置类属性值
             String methodname="set"  + Character.toUpperCase(fname.charAt(0)) + fname.substring(1);
             System.out.println(methodname);
                Method method = clazz.getDeclaredMethod(methodname, ftype); //获取定义的方法
                if (!Modifier.isPublic(method.getModifiers())) {   //设置非共有方法权限
                    method.setAccessible(true);   
                }   
                method.invoke(target, fvalue);  //执行方法回调
            } catch (Exception me) {//如果set方法不存在,则直接设置类属性值
          
                try {   
                    Field field = clazz.getDeclaredField(fname);   //获取定义的类属性
                    if (!Modifier.isPublic(field.getModifiers())) {   //设置非共有类属性权限
                        field.setAccessible(true);   
                    }   
                    field.set(target, fvalue); //设置类属性值
                    
                } catch (Exception fe) {   
             
                }   
            }   
        }  
      

  3.   

    理解是:传过来一个集合对象,然后你通过遍历SoapObject 
    out=anyType{IPRFolder=anyType{folderName=ipr_txt; folderVersion=1; 
    取得一个个PropertyInfo集合中某个对象
    通过遍历某个对象属性,相对应的去赋值给java对象,最后得到集合
      

  4.   

    我的这样:anyType{string=660a3c70-25cd-42d7-8d27-a12400ec914c; string=普通用户; string=0; string=46c245c4-0545-448d-a936-a171010a1adf; string=品牌店铺; string=0; string=f92868ac-73d6-468e-82a5-a171010a2473; string=生产厂家; string=0; string=9af7e949-345a-4b94-8ca8-a171010a4043; string=建材市场; string=0; string=8c88b47b-689f-422d-8a82-a171010a492e; string=装饰公司; string=0; string=700042a0-4b56-4b76-a5dc-a171010a5cb7; string=设计公司; string=0; string=baebe35b-86b6-4523-90ff-a171010a6320; string=物流公司; string=0; string=da8eab75-3f51-42e0-b6d3-a17200aea69f; string=行业协会; string=0; string=78ca0de0-90ca-49df-b0bc-a19400f1f9ed; string=开发商; string=0; }
    所有的信息都在一条里了怎么处理?