Magento – SOAP connection couldn’t load

magento-1.9php-5.5soap-api-v2wsdl

I am getting the same error over and over again on a SOAP request of a Magento 1.9 shop.

If I open the SOAP url directly in my browser (https://www.ourshop.com/shop/index.php/api/v2_soap/index/) I get this message:

<faultstring>
SOAP-ERROR: Parsing WSDL: Couldn't load from '<same url but removed due to too low reputation>?wsdl=1' : failed to load external entity "<same url but removed due to too low reputation>"
</faultstring>

I know this thing is working, cause our dev environment it gives me a proper answer on the call.

I tried adding the domain to the server hosts file, but that didn't work. PHP versions of our dev and live environment are different so that could be it.

SOAP is installed:

# php -i | grep soap Configure Command =>  './configure'  '--with-apxs2' '--with-curl=/usr/local/lib' '--with-gd' '--with-ttf' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pdo-mysql=/usr' '--with-pcre-regex=/usr/local' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-xsl' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-magic-quotes' '--enable-safe-mode' '--enable-soap' '--enable-sockets' '--enable-mbstring' '--enable-zip' '--enable-wddx' soap soap.wsdl_cache => 1 => 1 soap.wsdl_cache_dir => /tmp => /tmp soap.wsdl_cache_enabled => 1 => 1 soap.wsdl_cache_limit
=> 5 => 5 soap.wsdl_cache_ttl => 86400 => 86400

PHP version is:

# php -v
PHP 5.5.34 (cli) (built: Apr  7 2016 10:19:11) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.20, Copyright (c) 2002-2016, by ionCube Ltd.
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

OpenSSL has been installed:

# openssl
OpenSSL> version
OpenSSL 1.0.1e-fips 11 Feb 2013

Just don't know now what?

edit:
Thanks for the support! I tried following:
– Curl the url when logged into the server gives the same result as when I try to load the page in my browser. All the same "SOAP-ERROR: Parsing WSDL: Couldn't load from…" error.

  • It also doesn't matter if I load …./api/v2_soap/index/ or …/api/v2_soap/
    All the same "SOAP-ERROR: Parsing WSDL: Couldn't load from…" error.

Today I tried to rule out some possibilities.
1. I installed a fresh Magento install on the same server. The server is loading the soap url correctly with http:// but I get the same error when loading the page on https://

  1. I installed the empty Magento on another server (with pretty a similar installation of CentOS 6 / Apache / PHP). The soap url is loading correctly on http:// and https://

Conclusion: my production server is having trouble with SOAP & SSL combo.

I compared http-ssl.conf files of both server. The're similar!?

Best Answer

It seems your URL is wrong.

It should be

https://www.ourshop.com/shop/index.php/api/v2_soap/?wsdl=1

instead of

https://www.ourshop.com/shop/index.php/api/v2_soap/index/
Related Topic