Magento 1.9 – Fix SOAP Error: Parsing WSDL: Couldn’t Load External Entity

magento-1.9soapsoap-api-v2

enter image description here

We are developing an android app for a magento site. We have to pass SOAP API from magento to android to get session id.

We created SOAP web user and roles in magento admin panel by following this link:

https://www.yireo.com/tutorials/magebridge/administration/596-step-by-step-create-a-magento-api-user

When we try to connect from android to magento, we are getting error. This is the link we are using:

http://videomergerapp.com/index.php/api/v2_soap/

Best Answer

SOAP server needs to be initialized with WSDL to understand how to process incoming requests (it basically loads WSDL from the specified URL in case of Magento). This happens in \Mage_Api_Model_Server_Adapter_Soap::_instantiateServer():

$this->_soap = new Zend_Soap_Server(
    $this->getWsdlUrl(array("wsdl" => 1)),
    array('encoding' => $apiConfigCharset)
);

Note that getWsdlUrl() constructs WSDL URL based on your Magento instance base URL. It means that if your Magento store is not accessible from the the host where it is deployed, SOAP server will not be able to load WSDL during initialization. As a result you would encounter such error when trying to perform requests to Magento SOAP API.

Related Topic