Warning: file_put_contents(/datas/wwwroot/jiajiahui/core/caches/caches_template/2/default/show.php): failed to open stream: Permission denied in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 55

Warning: chmod(): Operation not permitted in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 56
没有错误,但没有执行后尝试catch语句 - 源码之家

没有错误,但没有执行后尝试catch语句

问题描述:

我想显示数据使用Web服务。该代码没有给出错误,但按钮点击执行发生最多只能尝试的一部分,没有什么超出了是执行没有错误,但没有执行后尝试catch语句

try { 
       Toast.makeText(getApplicationContext(), "You r in try", Toast.LENGTH_LONG).show(); 
       HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
       //this is the actual part that will call the webservice 
       androidHttpTransport.call(SOAP_ACTION1, envelope);     
       // Get the SoapResult from the envelope body. 
       SoapObject result = (SoapObject)envelope.bodyIn; 
       //from here nothing executes but gives no error 
       ****if(result != null**) 
       { 
        Toast.makeText(getApplicationContext(), "You r in if", Toast.LENGTH_LONG).show(); 
         //Get the first property and change the label text 
         tv1.setText(result.getProperty(0).toString());  
       } 
       else 
       { 
         Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_LONG).show(); 
       } 
      } catch (Exception e) { 
       e.printStackTrace(); 
      }       
     } 
    }); 
+0

您是否尝试过烘烤结果?您是如何得到 – Payal 2013-02-09 11:13:44

+1

清洁您的项目,然后再试一次。也不用烤面包。使用Log.i(“TAG”,“Your message”); – 2013-02-09 11:14:34

+0

为什么不调试应用程序并在有问题的区域放置断点? – 2013-02-09 12:07:12

你调用抛出异常的几种方法。

“跳过”代码表示抛出了异常。

在catch块中放置面包以确认。

+0

androidHttpTransport.call(SOAP_ACTION1,envelope);这行代码没有被执行休息,我通过放置烤面包来检查。 – 2013-02-11 10:16:36

+0

我有一个更具体的问题:如果你在catch块中放了一个烤面包,你会看到烤面包吗?如果你这样做,那么抛出异常。 – chr 2013-02-12 01:03:25