2011-10-14 49 views
0

我正嘗試用yii創建一個簡單的示例web服務。我遵循這些directions,但是當我嘗試訪問WSDL以查看生成的yii時,發生錯誤。參觀WSDL在http://localhost/mywebapp/index.php/L1Folio/folio訪問Yii生成WSDL時XML解析錯誤

錯誤:

XML Parsing Error: junk after document element 
Location: http://localhost/paperless_admin/index.php/L1Folio/folio 
Line Number 4, Column 1: 
<table class="yiiLog" width="100%" cellpadding="2" style="border-spacing:1px;font:11px Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;color:#666666;"> 
^ 

代碼:

L1FolioController.php:

<?php 

class L1FolioController extends CController 
{ 
    public function actions() 
    { 
     return array(
      'folio'=>array(
       'class'=>'CWebServiceAction', 
      ), 
     ); 
    } 
    /** 
    * @param string the folio 
    * @return string the statement 
    * @soap 
    */ 
    public function sendFolio($folio) 
    { 
     return 'it works'; 
    } 

} 

感謝您的幫助。

回答

0

找到了答案。日誌記錄選項與WSDL XML衝突。您的main.php配置在日誌部分應如下所示:

'log'=>array(
         'class'=>'CLogRouter', 
         'routes'=>array(
           array(
             'class'=>'CFileLogRoute', 
             'levels'=>'error, warning',           
           ), 
           // uncomment the following to show log messages on web pages        
           /*array(
             'class'=>'CWebLogRoute', 
           ),*/ 

         ), 
       ),