SOAP error: failed to load external entity

3,477 views
Skip to first unread message

rob....@euautomation.com

unread,
May 31, 2017, 4:56:05 AM5/31/17
to AdWords API Forum
I've started getting this error over the last couple of days, but I've only just noticed today. It is not just the "CampaignService", I'm also getting it on the "AdGroupService". Here is the stack trace for the error.

SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords.google.com/api/adwords/cm/v201702/CampaignService?wsdl' : failed to load external entity "https://adwords.google.com/api/adwords/cm/v201609/CampaignService?wsdl"
 in /var/www/html/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php:65
Stack trace:
#0 /var/www/html/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(65): SoapClient->SoapClient('https://adwords...', Array)
#1 /var/www/html/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/v201702/cm/CampaignService.php(143): Google\AdsApi\Common\AdsSoapClient->__construct('https://adwords...', Array)
#2 [internal function]: Google\AdsApi\AdWords\v201702\cm\CampaignService->__construct(Array)
#3 /var/www/html/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php(39): ReflectionClass->newInstanceArgs(Array)
#4 /var/www/html/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClientFactory.php(87): Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', Array)
#5 /var/www/html/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsServices.php(55): Google\AdsApi\Common\AdsSoapClientFactory->generateSoapClient(Object(Google\AdsApi\AdWords\AdWordsSession), Object(Google\AdsApi\AdWords\AdWordsHeaderHandler), Object(Google\AdsApi\AdWords\AdWordsServiceDescriptor))
#6 /var/www/html/app/Drivers/Adwords/AdWordsServices.php(52): Google\AdsApi\AdWords\AdWordsServices->get(Object(Google\AdsApi\AdWords\AdWordsSession), 'Google\\AdsApi\\A...')

I've tried loading the file over curl from the same server and it works perfectly.

< HTTP/1.1 200 OK
< Content-Type: text/xml
< Date: Wed, 31 May 2017 08:52:59 GMT
< Expires: Wed, 31 May 2017 08:52:59 GMT
< Cache-Control: private, max-age=0
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< Server: GSE
< Alt-Svc: quic=":443"; ma=2592000; v="38,37,36,35"
< Accept-Ranges: none
< Vary: Accept-Encoding
< Transfer-Encoding: chunked

Peter Oliquino

unread,
May 31, 2017, 5:52:38 AM5/31/17
to AdWords API Forum
Hi Rob,

Could you try and see if the instructions mentioned here resolves your issue? If it doesn't, please create a new issue on the PHP client library and share your error logs there. The PHP library owners are better equipped to assist you. 

Best regards,
Peter
AdWords API Team

rob....@euautomation.com

unread,
May 31, 2017, 9:45:00 AM5/31/17
to AdWords API Forum
Hi Peter,

Thanks for getting back to me. I had a go at instructions and they didn't help, but I've manage to fix it now. Adding this line of code managed to fix it.

libxml_disable_entity_loader(false);

I future I shall go there first. :)

Kind Regards,
Rob
Reply all
Reply to author
Forward
0 new messages