文件本身也没错误 应该就是写的xml方式有问题,也没有用过你解析的那个类;
你先找个简单的能解析xml成功的共用的调用webservice的比较下吧 比如什么天气信息的那种
看看别人怎么写的
你先找个简单的能解析xml成功的共用的调用webservice的比较下吧 比如什么天气信息的那种
看看别人怎么写的
解决方案 »
- Arcgis for Android 问题 无法启动调试...
- 以下是Ubuntu 下执行命令行 ./grxmlcompile -par /home/SREC/baseline11k.par -grxml digits.g
- Android 有关ViewFlipper的问题
- android 音频问题
- 如何直接打开后台程序
- android OPENCORE怎么调用底层MFC硬解码?
- Android Button Click疑惑
- 读取sdcard中的txt文档
- android 异步调用webservice问个问题
- android怎么实现代码输入,显示不同颜色
- 定时器和开机通知都没有效果,在线求助
- android编程百度地图
我调用 webservice不带参数的方法和带一个参数的方法 都能得到数据 带两个参数就报这个异常。不知道 怎么回事。哪位达人解决下。
我这的问题解决了。
下面是我的代码
public String GetDataByWeb(String mthod,Object[] params)
{
soap=new SoapObject(WSNamespace,mthod);
if(params.length==1)
soap.addProperty("GroupList", params[0]);
else
{
soap.addProperty("Uname",params[0]);
soap.addProperty("PassWord", params[1]);
}
envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut=soap;
envelope.dotNet=true;
AndroidHttpTransport transport=new AndroidHttpTransport(WSUrl);
transport.debug=true;
try {
transport.call(WSNamespace+mthod, envelope);
if(envelope.getResponse()!=null){
SoapObject retValue=(SoapObject) envelope.getResponse();
return retValue.getProperty(0).toString();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "IOException";
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "XmlPullParserException";
}
return "error";
}//////个人感觉 参数名称很重要 我收到了数据 还没有做解析 envelope.dotNet=true; 我设置的是true
楼主试试 看对不
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork() // or .detectAll() for all detectable problems
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.penaltyLog()
.penaltyDeath()
.build()); 就好了,我也是今天才找到解决的办法的
static final String SERVICE_URL = "http://172.16.1.10/oa/services/UserWebService?wsdl";
改成
static final String SERVICE_URL = "http://172.16.1.10/oa/services/UserWebService";
就可以了
把static final String SERVICE_URL = "http://172.16.1.10/oa/services/UserWebService?wsdl";
改成static final String SERVICE_URL= "http://172.16.1.10/oa/services/UserWebService";
就可以了本人亲自试过
public void allRegion() {
// 声明一个webservice客户端
WebserviceClient client = new WebserviceClient("http://www.xxxx.com:8088/apk/webservice", "regionWs", "allRegion",
null, List.class, Region.class);
List<Region> list = client.execute();// 执行以下webservice客户端,就得到了一个List,轻松搞定
for (Region member : list) {
System.out.println(member.getName());
}
}我们都是这样调webservice的
好像你那代码又长又啰嗦