访问 Yii 生成的 WSDL 时 XML 解析错误
我正在尝试使用 yii 创建一个简单的示例 Web 服务。我遵循了这些说明,但是当我遇到错误时我尝试访问 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';
}
}
感谢您的帮助。
I'm trying to create a simple example web service with yii. I followed these directions, but I'm getting an error when I try to visit the WSDL to view what yii generated. Visiting the WSDL at http://localhost/mywebapp/index.php/L1Folio/folio
Error:
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;">
^
Code:
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';
}
}
Thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了答案。日志记录选项与 WSDL XML 冲突。您的 main.php 配置在日志部分中应如下所示:
Found the answer. The logging options conflict with the WSDL XML. Your main.php config should look like this in the log section: