Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetCampaigns.php running on terminal but giving an error while running on web browser #333

Closed
adhippatil opened this issue Jul 28, 2017 · 6 comments
Assignees

Comments

@adhippatil
Copy link

Hello AdWords API team,
I am running 'GetCampaigns.php' from terminal ,it is showing the list of campaigns. But when I ran it on web browser, it is giving me an error :
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl' : failed to load external entity "https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl" in /opt/lampp/htdocs/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php:65 Stack trace: #0 /opt/lampp/htdocs/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(65): SoapClient->SoapClient('https://adwords...', Array) #1 /opt/lampp/htdocs/googleads-php-lib/src/Google/AdsApi/AdWords/v201705/cm/CampaignService.php(145): Google\AdsApi\Common\AdsSoapClient->__construct('https://adwords...', Array) #2 [internal function]: Google\AdsApi\AdWords\v201705\cm\CampaignService->__construct(Array) #3 /opt/lampp/htdocs/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php(39): ReflectionClass->newInstanceArgs(Array) #4 /opt/lampp/htdocs/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClientFactory.php(86): Google\AdsApi\Common\Util\Refl in /opt/lampp/htdocs/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php on line 65

What should I do to see it running in the web browser also? Please help me!

@fiboknacky fiboknacky self-assigned this Jul 28, 2017
@fiboknacky
Copy link
Member

Hello @adhippatil

First, our code examples are meant to run in command prompt only as stated here.
So, if you run it on the webpage, you may not see the result as usual.

Despite that, the error message above looks like a separate problem.
It seems the WSDLs can't be accessed from your server.
Could you please check if you have any firewall or settings that prevent the access?

One thing that you can check if to use curl or wget to fetch the content from https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl in your server.
You can also try opening the link in the browser to check as well.

Best,
Thanet, AdWords API Team

@adhippatil
Copy link
Author

adhippatil commented Jul 31, 2017

Hello Thanet,
Thanks for the reply. Do you have an example which runs on web browser? If you give it to me that will be great

I hit the url https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl in my browser, I am seeing this XML file
xml_file
I am using ubuntu 14.04 o/s on my pc

@fiboknacky
Copy link
Member

Hello @adhippatil

Sorry for late reply.
We don't have examples that run on the browser directly but it should be straightforward to adapt from the existing ones. You can extract a part of runExample() and put it in your function to show results on the web page.

Based on the result you've shown to us, it looks like your computer can access the AdWords API servers and WSDL files, so this wouldn't be a problem of connectivity.

Best,
Knack

@theainz
Copy link

theainz commented Oct 19, 2017

Hi Knack,

Can you expand a little on the comment about runExample and getting the code to work in a browser please?

Thanks, Neil

@fiboknacky
Copy link
Member

Hi Neil,

Sure I'm considering that too.

Knack

@theainz
Copy link

theainz commented Oct 19, 2017

Thanks, to be honest, I'm not sure how else I would run it in my programs to work out what's working / not working & develop something useful. :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants