phpmagentosoapwsdlmagento-soap-api

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


I try to use magento webservice but whene i try to call the webservice :

$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),

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);

Solution

  • Do you have a host entry for mydomain.com that points to your 127.0.0.1 address? Can you actually see the wsdl in your browser if you visit the URL manually? Do you have all the PHP libraries installed like simplexml? 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. Do you have the log enabled and is there any error in the magento system or exception log?

    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? If so, have you configured the site base URL's in the admin? I suspect it may be a DNS issue at this moment.