我正在使用ksoap
庫調用webservice
。在某些情況下,服務運行正常,但在一個案例中,主機名稱未經驗證 下面是我的代碼調用webservice
。主機名未驗證ANDROID
HttpTransportSE httpTransport = new HttpTransportSE(URL, MessageConstant.TIMEOUT_TIME);
httpTransport.debug = true; // this is optional, use it if you don't want to use a packet sniffer to check what the sent message was (httpTransport.requestDump)
httpTransport.call(SOAP_ACTION, envelope); // send request
這裏是我的同
java.io.IOException: Hostname 'XXX.XX.XXX.XXX' was not verified
at libcore.net.http.HttpConnection.verifySecureSocketHostname(HttpConnection.java:223)
at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:446)
at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
at libcore.net.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:165)
at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:76)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:152)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)