Question

I am using the Soap api's of the Magento. While using the webservices i am getting the below issue

Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't find

I have made all the extensions enable on the server.

I have used the below code to make the Soap api as the client api.

require_once('../app/Mage.php');

Mage::app();
$store_url =Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
$store_url=$store_url.'index.php/api/soap/?wsdl';
$options = array(

                'soap_version'=>SOAP_1_1,

                'exceptions'=>0,

                'trace'=>1,

                'cache_wsdl'=>0,

       //'features' => SOAP_USE_XSI_ARRAY_TYPE,

       ); 

$proxy = new SoapClient($store_url,$options);

Guide me where i am doing something wrong. Any help is appreciated.

Was it helpful?

Solution

I tested your code and it works perfectly for me.
From this line: require_once('../app/Mage.php'); I assume you placed the client code in a subfolder of your Magento instance. Am I right?
Also if you can change the way you get the wsdl url from this:

$store_url =Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
$store_url=$store_url.'index.php/api/soap/?wsdl';

To this:

$store_url = Mage::getUrl('api/soap/index', array('wsdl'=>1));

The truth is that I tested on PHP 5.3. Maybe the php version is an issue. Or the operating system.

I've seen some server configuration that gave the same error, but I don't remember the OS.
The wsdl should also be available at this url also. BASE_URL/api.php?type=soap&wsdl=1. Maybe that works for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top