调用Web服务时出错

时间:2015-05-22 16:41:13

标签: android httpurlconnection android-volley

当我尝试在进行大约8次API调用后使用volley调用Web服务时,我收到400错误代码。这个问题可以在4.0.4 samsung galaxy tab中重现。但它在更高版本的android

中工作正常

错误日志:

05-21 10:25:40.880    3947-3947/com.tc D/Volley? [1] DiskBasedCacheclear: Cache cleared.
05-21 10:25:40.890    3947-4028/com.tc I/qtaguid? Failed write_ctrl(t -1 2533528184876433408 -1) res=-1 errno=9
05-21 10:25:40.890    3947-4028/com.tc I/qtaguid? Tagging socket -1 with tag 2328e67600000000(-1557600650) for uid -1 failed errno=-9
05-21 10:25:40.890    3947-4028/com.tc I/NetworkManagementSocketTagger? tagSocketFd(-1, -1557600650, -1) failed with errno-9
05-21 10:25:41.160    3947-4028/com.tc I/qtaguid? Failed write_ctrl(t -1 2533528184876433408 -1) res=-1 errno=9
05-21 10:25:41.160    3947-4028/com.tc I/qtaguid? Tagging socket -1 with tag 2328e67600000000(-1557600650) for uid -1 failed errno=-9
05-21 10:25:41.160    3947-4028/com.tc I/NetworkManagementSocketTagger? tagSocketFd(-1, -1557600650, -1) failed with errno-9
05-21 10:25:41.430    3947-3947/com.tc E/TC? Web service tag: get_config_api_call
05-21 10:25:41.430    3947-3947/com.tc E/TC? onErrorResponse ----1com.android.volley.NoConnectionError: java.io.IOException: Unexpected response code for CONNECT: 400
05-21 10:25:41.430    3947-3947/com.tc E/TC? onErrorResponse com.android.volley.NoConnectionError: java.io.IOException: Unexpected response code for CONNECT: 400

出于测试目的,我用一个httpurlconnection取代了凌空调用,我也遇到了类似的错误。

错误日志:

-21 13:05:33.080    2515-2801/com.tc W/System.err? java.io.IOException: Unexpected response code for CONNECT: 400
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeTunnel(HttpsURLConnectionImpl.java:508)
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:462)
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:441)
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:273)
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:479)
05-21 13:05:33.150    2515-2801/com.tc W/System.err? at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:133)

我注意到只有在发出多个请求后调用API的情况下才会出现此问题。如果我在评论之前的多个请求之后简单地调用它,那么它将正常工作。

0 个答案:

没有答案