【问题标题】:XML Parsing error when accessing Yii generated WSDL访问 Yii 生成的 WSDL 时出现 XML 解析错误
【发布时间】:2011-12-07 20:30:06
【问题描述】:

我正在尝试使用 yii 创建一个简单的示例 Web 服务。我关注了这些directions,但是当我尝试访问 WSDL 以查看 yii 生成的内容时出现错误。访问 WSDL http://localhost/mywebapp/index.php/L1Folio/folio

错误:

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';
    }

}

感谢您的帮助。

【问题讨论】:

    标签: php xml web-services wsdl yii


    【解决方案1】:

    找到了答案。日志记录选项与 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',
                                    ),*/
    
                            ),
                    ),
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多