2015-04-28 72 views
0

我试图从Android上调用.NET webservice。 这是我的变量:SOAP请求似乎不起作用

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 

request.addProperty("userName", "Ale"); 
request.addProperty("password", "ciaociao"); 

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
envelope.dotNet = true; 
envelope.encodingStyle = "utf-8"; 
envelope.setOutputSoapObject(request); 

//Create HTTP call object 
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

try { 
    //Invole web service 
    androidHttpTransport.call(SOAP_ACTION, envelope); 
    //Get the response 
    SoapPrimitive response = (SoapPrimitive) envelope.getResponse(); 
    //Assign it to fahren static variable 
    risposta = response.toString(); 

} catch (Exception e) { 
    e.printStackTrace(); 
} 

当我开始它给了我这个错误的应用程序: enter image description here

什么是

private final String NAMESPACE = "http://www.greenparkvieste.it/"; 
private final String URL = "http://nursexpress.hellonetlab.it/service.asmx?op=UserLogin"; 
private final String SOAP_ACTION = "http://www.greenparkvieste.it/UserLogin"; 
private final String METHOD_NAME = "UserLogin"; 
private String risposta = ""; 

这在doInBackground在的AsyncTask我的方法执行错误?

+0

我解决了上传ksoap2库!!! – aletede91

回答