问题描述
- 关于soap post提交问题
-
可以返回数据。但是好像解析有问题,所以返回的都是错误的数据
SoapObject optionObject = new SoapObject(nameSpace, methodName);
SoapObject loginInfo1 = new SoapObject(nameSpace, methodName);
loginInfo1.addProperty("UserId", loginInfo.getUserId());
loginInfo1.addProperty("ClientName", loginInfo.getClientName());
loginInfo1.addProperty("SessionId", loginInfo.getSessionId());
loginInfo1.addProperty("RoleData", loginInfo.getRoleData());
optionObject.addProperty("loginInfo", loginInfo1);
optionObject.addProperty("latitude", 113);//维度
optionObject.addProperty("longitude", 22);//经度
optionObject.addProperty("province", "广东省");
optionObject.addProperty("city", "深圳");
optionObject.addProperty("district", "宝安区");
optionObject.addProperty("address", "中国广东省深圳市宝安区福围路商业街2号");// 生成调用WebService方法的SOAP请求信息,并指定SOAP的版本 final SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut = optionObject; // 设置是否调用的是dotNet开发的WebService envelope.dotNet = true; // 等价于envelope.bodyOut = rpc; envelope.setOutputSoapObject(optionObject); try { transport.call(soapAction, envelope); } catch (IOException e) { e.printStackTrace(); } catch (XmlPullParserException e) { e.printStackTrace(); } Log.e("tag", envelope.bodyIn.toString());
时间: 2024-09-27 09:24:29