首页 > 代码库 > android调用webservice方法

android调用webservice方法

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); 

  

android调用webservice方法