2013-05-14 144 views
3

我是android和and webservices的新成員。我正在嘗試訪問Web服務。我使用asp.net web服務,做所有這些工作asyntask.But它給了我錯誤的服務器無法處理請求。連接未關閉

05-14 15:28:20.838:E /錯誤:(28969):錯誤soapPrimitiveData()服務器無法處理請求`。連接未關閉。連接的當前狀態已打開。

這裏是我的代碼

 private String retriveFavrt(String user_id) { 

     SoapObject resultstring = null; 
     SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME_2); 


     request.addProperty("user_id", user_id);  
     SoapSerializationEnvelope soapenvelope = new SoapSerializationEnvelope(
       SoapEnvelope.VER11); 
     soapenvelope.dotNet = true;              
     soapenvelope.setOutputSoapObject(request); 

      HttpTransportSE httptransport = new HttpTransportSE(URL); 
      httptransport.debug = true; 


try { 
     httptransport.call(SOAP_ACTION_2, soapenvelope); 

     resultstring = (SoapObject) soapenvelope.getResponse(); 
     result2=resultstring.toString(); 
     et1.setText(result2); 
     System.out.println("result" +result2); 

     Log.i("try to retrive the favrt location list of a specific user",   resultstring.toString()); 
     System.out.println(resultstring); 


} 
catch (SocketException ex) { 
      et1.setText(ex.getMessage()); 

    Log.e("Error : " , "Error on soapPrimitiveData() " + ex.getMessage()); 
    ex.printStackTrace(); 
} catch (Exception e) { 
    Log.e("Error : " , "Error on soapPrimitiveData() " + e.getMessage()); 
    e.printStackTrace(); 
} 

return result2; 

     } 
     } 

請幫我提前來解決這個問題..謝謝。

這是錯誤:

05-14 16:18:13.705: E/SQLiteDatabase(32568): Error inserting user_id=null 
05-14 16:18:24.072: E/Error :(32568): Error on soapPrimitiveData() Server was unable to process request. ---> The connection was not closed. The connection's current state is open. 
+0

您能否粘貼異常的完整堆棧跟蹤? – 2013-05-14 11:07:10

+0

我編輯了我的代碼@user_CC。請檢查錯誤 – pareshy 2013-05-14 12:29:12

+0

您能否粘貼URL,NAMESPACE,METHOD_NAME_2,SOAP_ACTION_2 ...?@Faiza – 2013-05-15 06:46:47

回答

1

有您放置在你的問題的第一個根據你的錯誤消息,兩個錯誤是,用戶ID快到了爲空,你可以打印用戶ID和看到的是價值會提高嗎?

如果上述問題沒有解決問題,您還可以共享您獲得的第一個異常的完整堆棧跟蹤嗎?

第二個錯誤與服務器問題有關您是否可以檢查您是否正在服務器上接收請求?

+0

第一個錯誤是不相關的...我是保存它在SQLLite數據庫中,但現在不工作..第二個錯誤是奇怪的...幫我出PLZ @user_CC – pareshy 2013-05-15 06:14:51

+0

我看不到調用來保存sqlite數據庫中的變量?反正你的命名空間和soapaction變量應該以「http://」 – 2013-05-15 08:20:30

+0

做完「http://」完成,但仍然停留在這....我沒有使用sqlite數據庫...這是額外的一段代碼。 .... @user_CC – pareshy 2013-05-15 08:31:32

相關問題