Search code examples
androidasp.netweb-servicesksoap2

Server was unable to process request.Connection was not closed


I am new for android and and webservices. I am trying to access the web service . I am using asp.net webservices and doing all these work in asyntask.But it gives me error as

05-14 15:28:20.838: E/Error :(28969): Error on soapPrimitiveData() Server was unable to process request`.The connection was not closed. The connection's current state is open.

Here is my code

        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;

        }
         }

Kindly help me to resolve this problem.. Thanks in advance.

This is Error:

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.

Solution

  • There are two errors which you placed in your question the first one As per your error message is that userID is coming up as null can you print the userID and see what is the value coming up?

    Also can you share the complete stack trace of the very first exception you get if the above doesn't solves the problem?

    Also the second error relates to a server problem Can you check whether you are receiving the request on the server?