I am unable to connect to the Magento SOAP API v2 using PHP. The error that occurs is:
PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.example.com/index.php/api/v2_soap/index/wsdl/1/' : failed to load external entity "http://www.example.com/index.php/api/v2_soap/index/wsdl/1/"
As it seems, the WSDL is being loaded, but the external SOAP file which it includes not.
PHP connection code:
$client = new SoapClient('http://www.example.com/api/v2_soap?wsdl=1');
$session = $client->login('username', 'password');
Snip from v2_soap?wsdl=1 file:
<service name="MagentoService">
<port name="Mage_Api_Model_Server_V2_HandlerPort" binding="typens:Mage_Api_Model_Server_V2_HandlerBinding">
<soap:address location="http://www.example.com/index.php/api/v2_soap/index/"/>
</port>
</service>
Magento version is 1.5.1.0
.