Tell me more ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

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.

share|improve this question
Does your server know himself? This is quite often mistake during development not to add domain to hosts on the server machine. Magento needs WSDL to be accessible via web from that machine where it is hosted. – Zyava Jun 25 at 7:45
add comment (requires an account with 50 reputation)

1 Answer

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 Magento 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.

share|improve this answer
Thanks for the response i will try your suggestion – Naresh Sharma Jun 25 at 7:28
I am getting that BASE_URL/api.php?type=soap&wsdl=1. Earlier someone changed the server error then this issue arises. Don't know how to fix it now. – Naresh Sharma Jun 25 at 7:31
By BASE_URL I meant Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB). I forgot to say that. – Marius Jun 25 at 7:33
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.