简体   繁体   English

SOAP错误:解析WSDL:未定义实体'copy'Magento

[英]SOAP-ERROR: Parsing WSDL: Entity 'copy' not defined Magento

I try to use magento webservice but whene i try to call the webservice : 我尝试使用magento网络服务,但是当我尝试调用网络服务时:

$proxy = new SoapClient(' http://mydomain.com/magento/index.php/api/v2_soap/?wsdl '); $ proxy = new SoapClient(' http://mydomain.com/magento/index.php/api/v2_soap/?wsdl ');

I get this error : Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ' http://mydomain.com/magento/index.php/api/v2_soap/?wsdl ' : Entity 'copy' not defined\\n in /var/www/trunk/test.php:3\\nStack trace:\\n#0 /var/www/trunk/test.php(3), 我收到此错误:未捕获的SoapFault异常:[WSDL] SOAP错误:解析WSDL:无法从' http://mydomain.com/magento/index.php/api/v2_soap/?wsdl '加载:实体'copy '/var/www/trunk/test.php:3中未定义\\ n堆栈跟踪:\\ n#0 /var/www/trunk/test.php(3),

So this Entity 'copy' not defined can you tell me why this exactly , should i add something in my server ? 因此,这个未定义的实体“副本”可以告诉我为什么要这么做吗,我应该在服务器中添加一些内容吗?

 $proxy = new SoapClient('http://127.0.0.1/magento/index.php/api/soap/?wsdl=1');

// create authorized session id using api user name and api key
// $sessionId = $proxy->login('apiUser', 'apiKey');
$sessionId = $proxy->login('karimeri', 'xxxxxxx');

 // Get customer info for customer id = 1
$customerinfo = $proxy->customerCustomerInfo($sessionId,1);

print_r($customerinfo);

Do you have a host entry for mydomain.com that points to your 127.0.0.1 address? 您是否有mydomain.com的主机条目指向您的127.0.0.1地址? Can you actually see the wsdl in your browser if you visit the URL manually? 如果您手动访问URL,您是否可以在浏览器中实际看到wsdl? Do you have all the PHP libraries installed like simplexml? 是否已像simplexml一样安装了所有PHP库? If you install something like Charles web proxy and run the request it might yield more info as to what is happening like possible redirects and responses. 如果您安装了诸如Charles Web代理之类的东西并运行请求,它可能会提供有关正在发生的事情的更多信息,例如可能的重定向和响应。 Do you have the log enabled and is there any error in the magento system or exception log? 您是否启用了日志,并且magento系统或异常日志中是否存在任何错误?

Need a bit more info to help really. 需要更多信息以帮助您。 Also is the real error message relating to mydomain.com or does it actually say 127.0.0.1? 还是与mydomain.com有关的真正错误消息,还是实际上说127.0.0.1? If so, have you configured the site base URL's in the admin? 如果是这样,您是否已在管理员中配置了站点基本URL? I suspect it may be a DNS issue at this moment. 我怀疑目前可能是DNS问题。

Have you checked PHP requirments for soap. 您是否检查过PHP要求的肥皂。

bc-math
curl
gd,ImageMagick 6.3.7 (or later) or both
intl
mbstring
mcrypt
mhash
openssl
PDO/MySQL
SimpleXML
soap
xml
xsl
zip
PHP7 only:
    json
    iconv

Then, open SOAP extension Via cpanel 然后,通过cpanel打开SOAP扩展

– Log into cpanel –登录到cpanel

– Click “ Select PHP Version” – In “Current PHP version”, check php.net for the latest version. –单击“选择PHP版本” –在“当前PHP版本”中,检查php.net以获取最新版本。 PHP 5.4 or 5.5 is recommended. 建议使用PHP 5.4或5.5。 – Click Set as Current –单击设置为当前

– Then you can select SOAP in modules section –然后,您可以在“模块”部分中选择“ SOAP”

– Click Save –单击保存

View detail here 在这里查看详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM