【问题标题】:Magento API Error: XML declaration allowed only at the startMagento API 错误:仅在开始时允许 XML 声明
【发布时间】:2015-09-03 04:21:58
【问题描述】:

我正在尝试访问 Magento 的核心 API。当我尝试访问 url 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 文档。

【问题讨论】:

    标签: php xml api magento soap


    【解决方案1】:

    您可能在一些 php/phtml 文件中在开始 之后有空格。

    前面有空格的 xml 是无效的,会给出像你这样的错误。

    查看以下链接以获得进一步的解释:

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

    Find whitespace-injecting PHP files

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-25
      • 2015-06-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多