String NAMESPACE="http://WebXml.com.cn/"; String METHOD_NAME="getMobileCodeInfo"; String URL = "http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx"; String SOAP_ACTION = "http://WebXml.com.cn/getMobileCodeInfo"; SoapObject rpc = new SoapObject(NAMESPACE, METHOD_NAME); rpc.addProperty("mobileCode",phoneSec); rpc.addProperty("userId",""); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut = rpc; envelope.dotNet = true; envelope.setOutputSoapObject(rpc); HttpTransportSE ht = new HttpTransportSE(URL); ht.debug = true; ht.call(SOAP_ACTION, envelope); // 获取返回的数据 SoapObject object = (SoapObject) envelope.bodyIn; // 获取返回的结果 String result = object.getProperty(0).toString(); t1.setText(result);
时间: 2024-10-12 23:37:10