2015-04-28 83 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

回答