NSClient ++获取服务器错误消息

时间:2013-03-27 13:57:55

标签: android web-services ws-client

尝试使用WSClient ++连接webServis时遇到问题。

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

        }

我试图获得erorrMessage。但当ı运行应用程序。

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

怎么能解决这个问题?

0 个答案:

没有答案