benoffi7/ksoap2-android

android-ksoap2 HttpsTransportSE.Call(SOAP_ACTION, envelope) trows null pointer exception on android 3 and lower

Opened this issue · 5 comments


my ksoap2 jar is this
ksoap2-android-assembly-3.1.0-jar-with-dependencies.jar


im trying to make a request to a server with https. Every thing works fine with 
Android 4 and 4.1, but with android 3 and lower dosent work, i have have null 
pointer ecxeption with the Call method 

HttpsTransportSE androidHttpTransport = new 
HttpsTransportSE(HOST,PORT,"miIusacell/services/miIusacellService",timeOut);
            androidHttpTransport.setUrl("https://10.203.25.149:8080/mitest/services/miService");
            ((HttpsServiceConnectionSE) androidHttpTransport.getServiceConnection()).setSSLSocketFactory(getSSLSocketFactory());
            Log.i("WSclient", "androidHttpTransport");
            androidHttpTransport.debug = true;
            _FakeX509TrustManager.allowAllSSL();

            Log.d("WSclient", "HTTP before CALL");
            try{
            androidHttpTransport.call(SOAP_ACTION, envelope);//<--- HERE
}catch(Exception ee){
                Log.d("WSclient", "catch CALL");
                ee.printStackTrace();
            }



03-27 13:24:15.606: D/WSclient(494): catch CALL
03-27 13:24:15.606: W/System.err(494): java.lang.NullPointerException
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.ha
shCode(HttpConnection.java:296)
03-27 13:24:15.616: W/System.err(494):  at 
java.util.HashMap.get(HashMap.java:302)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(Ht
tpConnectionPool.java:73)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.get
HttpConnection(HttpURLConnectionImpl.java:292)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.mak
eConnection(HttpURLConnectionImpl.java:274)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$H
ttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:447)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$H
ttpsEngine.makeConnection(HttpsURLConnectionImpl.java:419)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.con
nect(HttpURLConnectionImpl.java:217)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.get
OutputStream(HttpURLConnectionImpl.java:624)
03-27 13:24:15.616: W/System.err(494):  at 
org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.g
etOutputStream(HttpsURLConnectionImpl.java:293)
03-27 13:24:15.616: W/System.err(494):  at 
org.ksoap2.transport.HttpsServiceConnectionSE.openOutputStream(HttpsServiceConne
ctionSE.java:123)
03-27 13:24:15.616: W/System.err(494):  at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:185)
03-27 13:24:15.616: W/System.err(494):  at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118)
03-27 13:24:15.616: W/System.err(494):  at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113)



Original issue reported on code.google.com by aazhe...@gmail.com on 27 Mar 2014 at 7:22

[deleted comment]
how can i edit the issue i have posted?

Original comment by aazhe...@gmail.com on 27 Mar 2014 at 7:48

You can just add comments.

Original comment by mosa...@gmail.com on 9 May 2014 at 6:32

@Aaze Any luck, where u able to fix it.


I am also getting the same error

07-04 05:20:01.800: W/System.err(1354): javax.net.ssl.SSLHandshakeException: 
java.security.cert.CertPathValidatorException: Trust anchor for certification 
path not found.
07-04 05:20:02.060: W/System.err(1354):     at 
com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.jav
a:409)
07-04 05:20:02.060: W/System.err(1354):     at 
com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
07-04 05:20:02.110: W/System.err(1354):     at 
com.android.okhttp.Connection.connect(Connection.java:107)
07-04 05:20:02.110: W/System.err(1354):     at 
com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
07-04 05:20:02.110: W/System.err(1354):     at 
com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:25
5)
07-04 05:20:02.110: W/System.err(1354):     at 
com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
07-04 05:20:02.160: W/System.err(1354):     at 
com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnection
Impl.java:345)
07-04 05:20:02.160: W/System.err(1354):     at 
com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnection
Impl.java:89)
07-04 05:20:02.160: W/System.err(1354):     at 
com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLCo
nnectionImpl.java:197)
07-04 05:20:02.210: W/System.err(1354):     at 
com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURL
ConnectionImpl.java:254)
07-04 05:20:02.210: W/System.err(1354):     at 
org.ksoap2.transport.ServiceConnectionSE.openOutputStream(ServiceConnectionSE.ja
va:126)
07-04 05:20:02.300: W/System.err(1354):     at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:185)
07-04 05:20:02.300: W/System.err(1354):     at 
org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118)
07-04 05:20:02.310: W/System.err(1354):     at 
com.india.soapwebservice.SOAP_WebService.callWebservice(SOAP_WebService.java:127
)
07-04 05:20:02.310: W/System.err(1354):     at 
com.india.soapwebservice.SOAP_WebService$SOAPCallAyncTask.doInBackground(SOAP_We
bService.java:167)
07-04 05:20:02.310: W/System.err(1354):     at 
com.india.soapwebservice.SOAP_WebService$SOAPCallAyncTask.doInBackground(SOAP_We
bService.java:1)
07-04 05:20:02.310: W/System.err(1354):     at 
android.os.AsyncTask$2.call(AsyncTask.java:288)
07-04 05:20:02.310: W/System.err(1354):     at 
java.util.concurrent.FutureTask.run(FutureTask.java:237)
07-04 05:20:02.420: W/System.err(1354):     at 
android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
07-04 05:20:02.420: W/System.err(1354):     at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
07-04 05:20:02.420: W/System.err(1354):     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
07-04 05:20:02.490: W/System.err(1354):     at 
java.lang.Thread.run(Thread.java:841)
07-04 05:20:02.490: W/System.err(1354): Caused by: 
java.security.cert.CertificateException: 
java.security.cert.CertPathValidatorException: Trust anchor for certification 
path not found.
07-04 05:20:02.550: W/System.err(1354):     at 
com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:28
2)
07-04 05:20:02.550: W/System.err(1354):     at 
com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.j
ava:202)
07-04 05:20:02.550: W/System.err(1354):     at 
com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocket
Impl.java:611)
07-04 05:20:02.550: W/System.err(1354):     at 
com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
07-04 05:20:02.600: W/System.err(1354):     at 
com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.jav
a:405)


Any suggestion to fix this?

Original comment by invincib...@gmail.com on 4 Jul 2014 at 9:36

any suggestion?

Original comment by shweta_p...@omnipayments.com on 7 Apr 2015 at 11:48