Magento Soap Api接口出错无法使用

在给客户测试Magento Soap接口的时候出现如下错误提示。

This page contains the following errors:
error on line 3 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.

字面意思是在XML文件前出现了不该用的其它字符。在浏览器中访问页面api/v2_soap/?wsdl。在xml文件中,发现前面两行为空行,而能够正常访问的api都没有这两个空行,想到应该是这里出现的问题。在调试中发现,无法访问的API程序,曾经修改过index.php文件,正好有<?php标签之前有两行空行,删除之后即可正常调用API。

原文地址:https://www.cnblogs.com/focai/p/4371020.html