Skip to content

Uncaught SoapFault exception: [WSDL] SOAP-ERROR #402

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

Closed
ShayanArifButt opened this issue Nov 19, 2017 · 16 comments
Closed

Uncaught SoapFault exception: [WSDL] SOAP-ERROR #402

ShayanArifButt opened this issue Nov 19, 2017 · 16 comments
Assignees

Comments

@ShayanArifButt
Copy link

I have just installed using Composer , was able to get the refresh token successfully , then i tried to run GetCampaigns.php , and it gave this error. This error came both on command prompt as well as on browser. I am using Xampp on windows.

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 E:\xampp\htdocs\new_job\google_adwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php:76 Stack trace: #0 E:\xampp\htdocs\new_job\google_adwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php(76): SoapClient->SoapClient('https://adwords...', Array) #1 E:\xampp\htdocs\new_job\google_adwords\vendor\googleads\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 E:\xampp\htdocs\new_job\google_adwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\Util\Reflection.php(39): ReflectionCl in E:\xampp\htdocs\new_job\google_adwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php on line 76

@fiboknacky fiboknacky self-assigned this Nov 20, 2017
@fiboknacky
Copy link
Member

Hello @angular013

Do you face with this issue for all services and reporting? Or does it happen intermittently?
The new version (v32.0.0) now ships local WSDL files, so it doesn't rely on the live WSDLs anymore.
Could you please try this version too?

Best,
Knack

@ShayanArifButt
Copy link
Author

@fiboknacky, i posted the above issue using the latest version installed using composer command. I only tried to run GetCampaigns.php for now and always getting the above error

@ShayanArifButt
Copy link
Author

@fiboknacky , i installed using the command on composer page.
image

instead of the steps written below , which said to clone the repo:

image

will this be causing the issue ? maybe installing using "composer require googleads/googleads-php-lib" command did not install the latest version ?

@fiboknacky
Copy link
Member

Hello @angular013,

To install and run examples, an alternative way is to download a compressed tarball and follow the README.md file in the tarball.
But using git clone should definitely work as well.

In the latest commit, if there are local WSDLs, they will be used instead of the live ones.
Could you confirm if the WSDLs in https://github.com/googleads/googleads-php-lib/tree/master/resources/wsdls are used in AdsSoapClient.php and there is the resources directory in your project directory?
From the error message, it looks like that the live ones are still used.

By the way, if you can't even open https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl in your browser, this may be because of some network connection issues. Changing some environments (e.g., using other computers, OSes, XAMPP versions) may help us confirm this.

Best,
Knack

@ShayanArifButt
Copy link
Author

@fiboknacky , the resources directory seems to be present
image

and the link ( https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl ) is giving this page in the browser ,

image

and you said "Could you confirm if the WSDLs in https://github.com/googleads/googleads-php-lib/tree/master/resources/wsdls are used in AdsSoapClient.php"....in which line of 'AdsSoapClient.php' should i look to check if the local WSDLs are being used or not ?

@fiboknacky
Copy link
Member

I've added a line number in my previous reply already. Let me put it again here: https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/Common/AdsSoapClient.php?utf8=%E2%9C%93#L73

In particular, could you please if file_exists($localWsdlPath) is true? Does the $localWsdlPath path exist?

@ShayanArifButt
Copy link
Author

@fiboknacky , so i ran a test , and the local Wsdl path does not exist , i added a little code for testing in 'AdSoapClient.php'

image

and this is the output it gave:

image

@ShayanArifButt
Copy link
Author

i now echoed the local path also ,

image

@fiboknacky
Copy link
Member

I see. So it looks like the implementation isn't customized to Windows yet (there are some slashes mixed with backslashes). I'll work on this.

Meanwhile, we can instead focus on why your environment cannot access the live WSDLs.
Could you try using file_get_contents() on https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl?
Can your PHP access this resource?

@ShayanArifButt
Copy link
Author

ShayanArifButt commented Nov 20, 2017

@fiboknacky , so i tried to run;
echo file_get_contents("https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl?");
and it gave this error ;

image

there are some SSL issues which i encountered on XAMPP before also when i used CURL , so to fix it , i used to switch off the CURL SSL check. how should i switch off the SSL check in your library for this live WSDL ?

@ShayanArifButt
Copy link
Author

So i fixed the SSL issue on XAMPP , but now the code;
echo file_get_contents("https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl?");
gives this below error;

image

and the 'GetCampaigns.php' gived the below error now ;

image

@fiboknacky
Copy link
Member

We don't recommend to switch off SSL check but if you really need it, please have a look at disableSslVerifyPeer.

There are some troubleshooting methods that you may be interested in trying first, e.g., what we describe in README.
Guzzle also lists up the place where valid SSL CAs are looked for in Windows. Please see this section of its website.

More info about certificates when using XAMPP and Windows can be found here.

Best,
Knack

@fiboknacky
Copy link
Member

So i fixed the SSL issue on XAMPP , but now the code;
echo file_get_contents("https://adwords.google.com/api/adwords/cm/v201705/CampaignService?wsdl?");
gives this below error;

Looks like you have extra "?" at the end?

and the 'GetCampaigns.php' gived the below error now ;

It seems your request has hit the servers! At least, the issue with the library seems to be resolved.
For the USER_PERMISSION_DENIED error, it's related to AdWords API in general.
Could you please post your question in AdWords API Forum? There is a specialized team handling the questions related to AdWords API.

Best,
Knack

@ShayanArifButt
Copy link
Author

ShayanArifButt commented Nov 20, 2017

@fiboknacky , ok thanks i will look into that forum... just a quick question , there are alot of files when i installed through composer, around 9669 files , it caused my laptop to get stuck when i tried to extract

image

So can you confirm that if that is the actual file numbers for this library + dependencies , or i did something wrong when installing ?

@fiboknacky
Copy link
Member

That is correct. There are many stub files generated from WSDLs in the src/ folder.

@ShayanArifButt
Copy link
Author

the library is working now . The USER_PERMISSION_DENIED error was coming, because i created the OAuth credentials for my production manager Adwords account , but provided the test client account's clientCustomerId in the configuration file ''adsapi_php.ini". So i created the credentials again for my 'test manager account' , and used those credentials and it worked.

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

2 participants