I'm unsuccessfully trying to consume a SOAP webservice (I can't know which architecture is behind this WS, as it is an external service).
My code is :
try{
_FakeX509TrustManager.allowAllSSL();
_FakeX509TrustManager trustM = new _FakeX509TrustManager();
trustM.isServerTrusted(null);
InetAddress address = InetAddress.getByName("mirservicetest.sanita.finanze.it");
Log.i(IMEDCERTIFICATI,address.toString());
androidTransport.call(SOAP_ACTION, envelope,headerPropertyList);
//androidTransport.call(SOAP_ACTION, envelope,headerPropertyList);
SoapObject response=(SoapObject)envelope.getResponse();
Log.i(IMEDCERTIFICATI,"Ho ricevuto qualcosa dal ws");
Log.i(IMEDCERTIFICATI,response.toString());
//response.getProperty(0);
}catch(Exception ex){
ex.printStackTrace();
}
I had to allow all ssl certificate because this is a testing environment. The stack trace is the following:
01-16 19:18:39.117: D/imedcertificati(14282): Full SSL active on new operating system version 15
01-16 19:18:39.128: W/System.err(14282): java.lang.NullPointerException
01-16 19:18:39.156: W/System.err(14282): at libcore.net.http.HttpConnection$Address.hashCode(HttpConnection.java:343)
01-16 19:18:39.156: W/System.err(14282): at java.util.HashMap.get(HashMap.java:298)
01-16 19:18:39.156: W/System.err(14282): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:67)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:460)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:432)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
01-16 19:18:39.160: W/System.err(14282): at libcore.net.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:164)
01-16 19:18:39.160: W/System.err(14282): at it.senetech.iMedCertificati.utils.AndroidInsecureHttpsServiceConnectionSE.connect(AndroidInsecureHttpsServiceConnectionSE.java:117)
01-16 19:18:39.160: W/System.err(14282): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:152)
01-16 19:18:39.164: W/System.err(14282): at it.senetech.iMedCertificati.SendCertificato.onClick(SendCertificato.java:169)
01-16 19:18:39.164: W/System.err(14282): at android.view.View.performClick(View.java:3511)
01-16 19:18:39.164: W/System.err(14282): at android.view.View$PerformClick.run(View.java:14105)
01-16 19:18:39.164: W/System.err(14282): at android.os.Handler.handleCallback(Handler.java:605)
01-16 19:18:39.164: W/System.err(14282): at android.os.Handler.dispatchMessage(Handler.java:92)
01-16 19:18:39.164: W/System.err(14282): at android.os.Looper.loop(Looper.java:137)
01-16 19:18:39.168: W/System.err(14282): at android.app.ActivityThread.main(ActivityThread.java:4424)
01-16 19:18:39.168: W/System.err(14282): at java.lang.reflect.Method.invokeNative(Native Method)
01-16 19:18:39.168: W/System.err(14282): at java.lang.reflect.Method.invoke(Method.java:511)
01-16 19:18:39.168: W/System.err(14282): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-16 19:18:39.168: W/System.err(14282): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-16 19:18:39.168: W/System.err(14282): at dalvik.system.NativeStart.main(Native Method)
01-16 19:20:09.164: W/IInputConnectionWrapper(14282): showStatusIcon on inactive InputConnection
I tried to make it as readable as possible.
Thanks in advance for the help and sorry for my poor english.
Ok, this was caused by a wrong envelope constructor.