android应用程序中的SoapObject

时间:2013-05-03 10:28:35

标签: android soap

这是我的Android应用程序代码PerformDownload.java

的一些片段

公共课PerformDownload {

private final String NAMESPACE = "http://tempuri.org/";
private final String URL = "http://10.0.2.2:4304/Service1.asmx";

public String GetContacts(String username) throws IOException, XmlPullParserException
{
//  String result = null;

    final String SOAP_ACTION = "http://tempuri.org/GetContacts";
    final String METHOD_NAME = "GetContacts";

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

request.addProperty( “用户名”,用户名);

    SoapSerializationEnvelope envelope = new          SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true; // put this only if the web service is .NET one
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

    androidHttpTransport.call(SOAP_ACTION, envelope);
    KvmSerializable response=   (KvmSerializable)envelope.bodyIn;

我在SoapObject上遇到错误,SoapSerializationEnvelope(SoapEnvelope.VER11);等等。 为什么上面的代码没有访问soap协议。

0 个答案:

没有答案