-1

我没有成功尝试使用 SOAP Web 服务(我不知道这个 WS 背后的架构,因为它是一个外部服务)。

我的代码是:

   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();

    }

我不得不允许所有 ssl 证书,因为这是一个测试环境。堆栈跟踪如下:

    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

我试图让它尽可能可读。

提前感谢您的帮助,并为我糟糕的英语感到抱歉。

4

1 回答 1

0

好的,这是由错误的信封构造函数引起的。

于 2012-01-19T10:07:44.437 回答