{"id":6041,"date":"2014-04-12T02:53:40","date_gmt":"2014-04-12T02:53:40","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/12\/unable-to-connect-to-magento-soap-api-v2-due-to-failed-to-load-external-entity-collection-of-common-programming-errors-2\/"},"modified":"2022-08-30T15:50:18","modified_gmt":"2022-08-30T15:50:18","slug":"unable-to-connect-to-magento-soap-api-v2-due-to-failed-to-load-external-entity-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/12\/unable-to-connect-to-magento-soap-api-v2-due-to-failed-to-load-external-entity-collection-of-common-programming-errors-2\/","title":{"rendered":"Unable to connect to Magento SOAP API v2 due to &ldquo;failed to load external entity&rdquo;-Collection of common programming errors"},"content":{"rendered":"<p>I am unable to connect to the Magento SOAP API v2 using PHP. The error that occurs is:<\/p>\n<p><strong>PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn&#8217;t load from &#8216;http:\/\/www.mydomain.com\/index.php\/api\/v2_soap\/index\/wsdl\/1\/&#8217; : failed to load external entity &#8220;http:\/\/www.mydomain.com\/index.php\/api\/v2_soap\/index\/wsdl\/1\/&#8221;<\/strong><\/p>\n<p>As it seems, the WSDL is being loaded, but the external SOAP file which it includes not.<\/p>\n<p>PHP connection code:<\/p>\n<pre><code>$client = new SoapClient('http:\/\/www.domain.com\/api\/v2_soap?wsdl=1');\n$session = $client-&gt;login('username', 'password');\n<\/code><\/pre>\n<p>Snip from v2_soap?wsdl=1 file:<\/p>\n<pre><code>\n    \n        \n    \n\n<\/code><\/pre>\n<p>Magento version is <code>1.5.1.0<\/code>, official documentation can be found at http:\/\/www.magentocommerce.com\/wiki\/doc\/webservices-api\/introduction.<\/p>\n<p>Any help would be great!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t load from &#8216;http:\/\/www.mydomain.com\/index.php\/api\/v2_soap\/index\/wsdl\/1\/&#8217; : failed to load external entity &#8220;http:\/\/www.mydomain.com\/index.php\/api\/v2_soap\/index\/wsdl\/1\/&#8221; As it seems, the WSDL is being loaded, but the external SOAP file which it includes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,1],"tags":[],"class_list":["post-6041","post","type-post","status-publish","format-standard","hentry","category-magento","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6041"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6041\/revisions"}],"predecessor-version":[{"id":9019,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6041\/revisions\/9019"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}