Magento API错误:仅在开始时允许XML声明

时间:2015-09-03 04:21:58

标签: php xml api magento soap

我正在尝试访问Magento的核心API。当我尝试访问网址http://magentohost/index.php/api/soap/wsdl=1时,我收到了错误

This page contains the following errors:

error on line 1 at column 6: XML declaration allowed only at the start of the document

Below is a rendering of the page up to the first error.

我已经安装了xmlrpc,soap和其他据说需要但仍然没有运气的扩展程序。

我的主机中的其他magento实例显示

This XML file does not appear to have any style information associated with it. The document tree is shown below.

在它下面添加一段XML代码。

据说我的XML文档可能有空格,但我不知道应该修改哪个XML文档。

1 个答案:

答案 0 :(得分:2)

在启动<?php之前或文件末尾,关闭之后你可能在某些php / phtml文件中有空格?>。

带有前置空格的xml无效,并且会出现类似于你的错误。

请查看以下链接以获取进一步说明:

https://magento.stackexchange.com/questions/92139/space-added-before-every-magento-page-content

Find whitespace-injecting PHP files