1

我在尝试将 webServis 与 WSClient++ 连接时遇到问题。

protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            final DoveMan d = new DoveMan();

            Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    GetMealResponse a;
                    try {
                        a = d.getMeals(0);
                        Log.d("dene", a.getErrorMessage());
                    } catch (Exception e) {
                        Log.d("there is", "catch Block");// TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }
            });
            t.start();

        }

我尝试获取错误消息。但是当我运行应用程序时。

    03-27 13:49:25.200: D/there is(441): catch Block
03-27 13:49:25.200: W/System.err(441): com.neurospeech.wsclient.SoapFaultException: Server Error
03-27 13:49:25.200: W/System.err(441):  at com.neurospeech.wsclient.SoapWebService.postXML(SoapWebService.java:225)
03-27 13:49:25.200: W/System.err(441):  at com.neurospeech.wsclient.SoapWebService.getSoapResponse(SoapWebService.java:157)
03-27 13:49:25.200: W/System.err(441):  at servis.DoveMan.getMeals(DoveMan.java:53)
03-27 13:49:25.200: W/System.err(441):  at com.example.servertest.MainActivity$1.run(MainActivity.java:21)
03-27 13:49:25.200: W/System.err(441):  at java.lang.Thread.run(Thread.java:1019)

我得到这个消息并且 Log.d("dene", a.getErrorMessage()) 没有运行。

我怎样才能解决这个问题 ?

4

0 回答 0