public String login(String uid ,String pwd){
String result=null;
// 设置需调用WebService接口需要传入的两个参数mobileCode、userId
rpc.addProperty("uid", uid);
rpc.addProperty("pwd",pwd);
// 生成调用WebService方法的SOAP请求信息,并指定SOAP的版本
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
envelope.bodyOut = rpc;
// 等价于envelope.bodyOut = rpc;
envelope.setOutputSoapObject(rpc);
HttpTransportSE transport = new HttpTransportSE(url);
try {
// 调用WebService
transport.call(null, envelope);
result = envelope.getResponse().toString();
} catch (Exception e) {
e.printStackTrace();
}
// 获取返回的数据
// SoapObject object = (SoapObject) envelope.bodyIn;
// String result = object.getProperty("getMobileCodeInfoResult").toString();
return result;
}
在进行访问的时候 transport.call(null, envelope); 报错。
百度说是传值方式不对,,不知道是啥原因