android无法获取webservice返回的复杂类型数组 本帖最后由 wushuangman1127 于 2013-07-03 09:30:25 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 貌似webservice只能是返回简单类型的数据,你们自己定义一个格式 ,还是通过string返回,然后按照格式解析不就行了吗 你获取的返回值通过 envelope.getResponse(); 获取 我没用过这种方式。这是我们之前用的方式 返回的是字符串,但格式是json格式HttpTransportSE hts = new HttpTransportSE(URL + serviceName, TIME_OUT); // 启用调试 hts.debug = true; SoapSerializationEnvelope sse = new SoapSerializationEnvelope(SoapEnvelope.VER11); sse.dotNet = true; sse.bodyOut = request; hts.call(NAME_SPACE + nsService + method, sse); // 返回结果 SoapObject response = null; response = (SoapObject) sse.bodyIn; String result = null; try { result = response.getProperty(0).toString(); } catch (Exception e) { throw new UnknowException("返回数据为空"); }返回通过sse.bodyIn这个方式获取 ,你试试呢,如果response 不为null,解析就简单了撒 刚开始用getResponse()方法抛出Vector cannot cast to SoapObject异常,之后改成bodyIn获取返回值就没用问题了。谢谢各位的热心解答。不胜感激! 获取的google静态地图能不能只带中文 android mysql 在不同路径下运行android -h 出现不同结果, 对吗? android play市场,我要发布apk应用,可是问什么描述里面不可以写中文? 请教一个手机页面显示的问题 在JNI里怎么显示surface呢,并播放YUV数据 不知道哪里错了,帮忙看一下代码哦,谢谢啦 google market 能搜到比手机SDK版本高的软件吗? 小弟求教大家安卓错误 实现像QQ一样切换账号,对应所有activity数据 ui都会相应更新,怎么实现? 关于移动终端应用服务器地址的问题? 怎么实现类似360手机助手下载管理的界面
这是我们之前用的方式 返回的是字符串,但格式是json格式HttpTransportSE hts = new HttpTransportSE(URL + serviceName, TIME_OUT);
// 启用调试
hts.debug = true;
SoapSerializationEnvelope sse = new SoapSerializationEnvelope(SoapEnvelope.VER11);
sse.dotNet = true;
sse.bodyOut = request;
hts.call(NAME_SPACE + nsService + method, sse);
// 返回结果
SoapObject response = null;
response = (SoapObject) sse.bodyIn;
String result = null;
try {
result = response.getProperty(0).toString();
} catch (Exception e) {
throw new UnknowException("返回数据为空");
}
返回通过sse.bodyIn这个方式获取 ,你试试呢,如果response 不为null,解析就简单了撒