2 qq 33046363 qq_33046363 于 2016.03.19 14:38 提问

关于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());
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!