SoapObject resultObj = null;
try{
SoapObject rpc = new SoapObject(NAMESPACE, METHORD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.setOutputSoapObject(rpc);
rpc.addProperty("methodName", methodName);
rpc.addProperty("xmlInfo", xml_info);
String URL = SysConfig.getInstance().getRootPath()+"services/"+AXIS_NAME+"?wsdl";
HttpTransportSE ht = new HttpTransportSE(URL);
ht.debug = true;
String SOAP_ACTION = NAMESPACE+"/" + METHORD_NAME;
ht.call(SOAP_ACTION, envelope);
resultObj = (SoapObject)envelope.bodyIn;
}catch(Throwable ex){
Log.d("connect",ex.getMessage());
resultObj = new SoapObject(NAMESPACE, METHORD_NAME);
resultObj.addProperty("return", "登录连接异常");
}
在调测时,发现
String rtnStr = resultObj.getProperty("return").toString();