android - 服务器无法处理请求。连接未关闭

标签 android asp.net web-services ksoap2

我是 android 和 web 服务的新手。我正在尝试访问网络服务。我正在使用 asp.net webservices 并在 asyntask 中完成所有这些工作。但它给了我错误

05-14 15:28:20.838: E/Error :(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.

最佳答案

您在问题中放置了两个错误,第一个错误根据您的错误消息显示 userID 为空,您可以打印 userID 并查看出现的值是什么吗?

如果上述方法不能解决问题,您还可以分享第一个异常的完整堆栈跟踪吗?

第二个错误也与服务器问题有关,你能检查一下你是否在服务器上收到请求吗?

关于android - 服务器无法处理请求。连接未关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16541163/

相关文章:

Android 创建带有提醒时间的日历条目不起作用

android - 在 Android 设备上看不到选项菜单

c# - MachineToApplication 超出应用程序级别 - 这个错误是什么意思?

javascript - ASP.NET URL 编码不带 ?或变量名

c++ - 如何在C++中调用Web服务方法?

ruby-on-rails - 服务到服务认证、服务身份和访问权限管理

java - 如何从 Java 调用 Kotlin 标准库函数?

java - 在 Android ListView 适配器中存储字符串变量

c# - 读取.net中的程序集

c# - 纯粹从 aspx 页面使用 Web 服务