Android通过ksoap2使用webservice服务
String nameSpace="********";
String methodName="********";
String endPoint="********";
String soapAction=nameSpace+methodName;
SoapObject request=new SoapObject(nameSpace,methodName);
request.addProperty("key",value);
SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE ht=null;
try {
ht=new HttpTransportSE(endPoint,time);
ht.call(null,envelope);
if(envelope.getResponse()!=null){
SoapObject object= (SoapObject) envelope.bodyIn;
String result=object.getProperty(0).toString();
return result;
}
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
e.printStackTrace();
}