首页 新闻 搜索 专区 学院

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.webtest/com.example.w

0
悬赏园豆:100 [已解决问题] 解决于 2012-09-24 21:54

感觉应该是加粗的那几行出错了 

private List<String> getdata() {
        List<String> data = new ArrayList<String>();
  // 调用的方法
  String methodName = "DatasLoadedNote";
  // 创建HttpTransportSE传输对象
  HttpTransportSE ht = new HttpTransportSE(SERVICE_URL);
  ht.debug = true;
  // 使用SOAP1.1协议创建Envelop对象
  SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
    SoapEnvelope.VER11);
  // 实例化SoapObject对象
  SoapObject soapObject = new SoapObject(SERVICE_NS, methodName);
  soapObject.addProperty("Uname", "wang");
  // 将soapObject对象设置为 SoapSerializationEnvelope对象的传出SOAP消息
  envelope.bodyOut = soapObject;
  envelope.dotNet = true;
  try {
   // 调用Web Service
      ht.call(SERVICE_NS + methodName, envelope);
      if (envelope.getResponse() != null) {
       // 获取服务器响应返回的SOAP消息
       SoapObject result = (SoapObject) envelope.bodyIn;
       // 接下来就是从SoapObject对象中解析响应数据的过程了。
       SoapObject detail1 = (SoapObject) result.getProperty(0);
       SoapObject detail2 = (SoapObject) detail1.getProperty(1);
          detail3 = (SoapObject) detail2.getProperty(0);
//       detail4 = (SoapObject) detail3.getProperty(1);
//       String result1 = detail4.toString();
       
       
      }
  } catch (Exception e) {
   e.printStackTrace();
  }
  for (int i = 0; i < 2; i++) {
   result1 = detail3.getProperty(i).toString();
   data.add(result1);
  }
  return data;
 }

千手白狐的主页 千手白狐 | 初学一级 | 园豆:66
提问于:2012-09-22 15:47
< >
分享
最佳答案
1

result1赋值错误

千手白狐 | 初学一级 |园豆:66 | 2012-09-22 22:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册