如何在不使用kso​​ap的情况下从android调用dot net webservice?

时间:2013-01-21 11:03:44

标签: android web-services

是否有官方方式从Android调用dot net webservice而不使用kso​​ap库,官方我的意思是Android团队推荐?

1 个答案:

答案 0 :(得分:0)

String METHOD_NAME = "----------------"   // change
String SOAP_ACTION = "---------------";   // change
String NAMESPACE = "----------"
String URL="------------"; 



SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME);
Request.addProperty("  ","  ");
.
.
.
Object response;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.encodingStyle = SoapEnvelope.ENC;

envelope.dotNet = true;
envelope.setOutputSoapObject(Request);
HttpTransportSE httptransport = new HttpTransportSE(URL);  // HTTP call that URl


httptransport.debug=true;

httptransport.call(SOAP_ACTION,envelope);    // change
response = envelope.getResponse();

System.out.println("The response is:\n\n "+response);

String resp=response.toString();
System.out.println(resp);