PHP Magento SOAP-ERROR: WSDL Parsing: Failed to load from urlpath

I am trying to create a soap client by passing a URL that is hosted on my local machine in my dev environment, and I keep getting this error. I use this call and it worked fine.

Basically all I do is

$ client = new SoapClient (' http://virtual.website.com:81/api/?wsdl ');

If I go to the URL in the browser it will appear, so I know this is the right place. There are several similar posts on the Magento forums, but I don't know that this is a Magento problem. Everything that they mention is like a solution that I already have. They say to edit the hosts file, for example 127.0.0.1 website.com

I already have this since it is configured as a virtual host.

Here is the error in my error_log

[Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://virtual.website.com:81/api/soap/?wsdl' : XML declaration allowed only at the start of the document\n in /usr/local/sites/virtual.website.com/www/CUSTOMSCRIPTS/removeProductImages.php on line 6 [Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP Stack trace: [Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP 1. {main}() /usr/local/sites/virtual.website.com/www/CUSTOMSCRIPTS/removeProductImages.php:0 [Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP 2. SoapClient->SoapClient(*uninitialized*) /usr/local/sites/virtual.website.com/www/CUSTOMSCRIPTS/removeProductImages.php:6 

UPDATE :: I found that this is not a problem with SOAP, something adds extra spaces to my XML file.

+4
source share
5 answers

After changing your Magento URL or local environment settings, you should always empty the Magento / var / cache / folder. Usually all strange errors disappear with it.

0
source

It seemed to me that we were not able to enable the xmlrpc PHP extension. As soon as we did this, the error disappeared.

0
source

Also, the problem may be due to permissions in the soap.wsdl_cache_dir directory

0
source

I am late, but I hope that my answer will be useful to someone in the future.

I had exactly the same problem. I installed Zend Server (PHP 5.3.9) and got the same error. I searched a lot and applied all available solutions, but I couldn’t ... Finally, I installed wamp and then ran the “Soap Client” script and successfully executed it.

Then I realized that Zend Server (PHP 5.3.9) has a default error in the “Soap Client” Script. I uninstalled Zend Server (PHP 5.3.9) and installed Zend Server (PHP 5.4.11) and runs the “Soap Client” script there. This time it succeeds.

Conclusion: Use the latest version of PHP (Zend Server) or (Wamp Server), as some versions of PHP have the default “Soap Client” error mentioned above.

Thanks Kashif

0
source

I solved this on my WAMP setup by turning on the php_openssl extension, since the URL I downloaded was from https: // used.

0
source

Source: https://habr.com/ru/post/1311891/


All Articles