cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP Error. Failed to load external entity

SOAP Error. Failed to load external entity

Hi everybody,

 

I installed Magento2 in a Centos7 server with apache 2.4

 

I'm trying to use SOAP, but a get the error with a simple php script:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/soap/default?wsdl&services=integrationCustomerTokenServiceV1' : failed to load external entity "http://localhost/soap/default?wsdl&services=integrationCustomerTokenServiceV1"

 

In Magento Log, i can see:
main.CRITICAL: exception 'LogicException' with message 'Report ID: webapi-57582e5e959a2; Message: The docBlock of the method Magento\Store\Api\StoreRepositoryInterface::getList is empty.' in /var/www/html/vendor/magento/framework/Webapi/ErrorProcessor.php:194

 

If I can acces via browser, I get the next message:
<env:Envelope><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="es">Internal Error. Details are available in Magento log file. Report ID: webapi-57583025df2ad</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

 

I have default configuration,default installation without sample data and default .htaccess.

 

For this moment I only want to  access via localhost. I put in /etc/hosts
192.168.0.9 localhost

 

I do the same things in a WAMP server and I get succesful results, but in my CentOS server I didn't.

what can I do?

 
Thanks!

1 REPLY

Re: SOAP Error. Failed to load external entity

I use this script to test SOAP:

 

$opts = array(
    'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
);

$params = array (
	'encoding' => 'UTF-8', 
	'verifypeer' => false, 
	'verifyhost' => false, 
	'soap_version' => SOAP_1_2, 
	'trace' => 1, 
	'exceptions' => 1, 
	"connection_timeout" => 180, 
	'stream_context' => stream_context_create($opts),
	'cache_wsdl' => WSDL_CACHE_NONE
);
try{
$request = new SoapClient(
	'http://localhost/soap/default?wsdl&services=integrationCustomerTokenServiceV1',	
	$params
);


	$token = $request->integrationCustomerTokenServiceV1CreateCustomerAccessToken(array('username' => 'my_user_name', 'password' => 'my_password'));
}catch(Exception $e){
	echo $e->getMessage();
}

but in CentOS server always get:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/soap/default?wsdl&services=integrationCustomerTokenServiceV1' : failed to load external entity "http://localhost/soap/default?wsdl&services=integrationCustomerTokenServiceV1"