guelug / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
Apache License 2.0
0 stars 0 forks source link

Pecl OAuth extension is required to use OAuth 1. #94

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which version of the library are you using?
v201302

Which version of PHP are you using?
5.3.2

What steps will reproduce the problem?
By running example GetCampaigns.php

What is the expected output? What do you see instead?
Campaign List

Please provide any additional information below.
Getting error message "Validation failed for [oauthHandlerClass] with value []: 
Pecl OAuth extension is required to use OAuth 1. Or a custom OAuth handler can 
be specified in settings.ini."

We are using v201209 before and without error it was working perfectly. After 
update to v201302 it is giving error.

How i can avoid this error.

Original issue reported on code.google.com by chirag.e...@gmail.com on 9 May 2013 at 12:08

GoogleCodeExporter commented 8 years ago
Hi Chirag,

Can you confirm which method of Authentication you're using? Is it OAuth 1.0? 
Can you ensure you've installed the PECL OAuth extension?

The PECL OAuth extension can be found here:
http://pecl.php.net/package/oauth

Regards,

- Paul, AdWords API Team.

Original comment by api.pmat...@gmail.com on 9 May 2013 at 12:43

GoogleCodeExporter commented 8 years ago
Hi Paul,

Yes, I am using Oauth 1.0 for authentication.

No, PECL OAuth extension is not installed. 

Without that it is working fine till the v201209 but in latest v201302 it is 
not working.

what i can do to work Oauth 1.0 without extension install?

Thanks,
Chirag

Original comment by chirag.e...@gmail.com on 9 May 2013 at 2:26

GoogleCodeExporter commented 8 years ago
Hi Chirag,

Can you give us more information on why your environment won't work with PECL 
OAuth?

Regards,

- Paul, Adwords Api Team. 

Original comment by api.pmat...@gmail.com on 9 May 2013 at 2:36

GoogleCodeExporter commented 8 years ago
Hi Paul,

I have not changed any environment, i'm just replacing src code(folder) of old 
api with the new src code of api version 4.2.5, and it starts giving error - 
Validation failed for [oauthHandlerClass] with value [].

Thanks,
chirag

Original comment by chirag.e...@gmail.com on 9 May 2013 at 2:48

GoogleCodeExporter commented 8 years ago
Hi Chirag,

Since version 4.2.0, we've removed the AndySmithOAuthHandler:
https://code.google.com/p/google-api-adwords-php/source/browse/ChangeLog#20

Can you provide more information on why the PECL OAuth extension won't work 
with your environment?

Cheers,

- Paul, AdWords API Team. 

Original comment by api.pmat...@gmail.com on 9 May 2013 at 3:15

GoogleCodeExporter commented 8 years ago
Hello Paul,

Yes, It is due to new client library has no class for AndySmithOAuthHandler.
I had put manually under setting.ini and replace the old AndySmithOAuthHandler 
to new API.

Now its working.

But i am still disappoint why new API needs to install Oauth Pecl extension.
My server is not contain it is as default.

Thanks,
Chirag

Original comment by chirag.e...@gmail.com on 10 May 2013 at 6:38

GoogleCodeExporter commented 8 years ago
Hello Paul,

After installing PECL Oauth Extension on server, now i am getting desired data.
But it is also giving me error.
"
A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant OAUTH_REQENGINE_CURL - assumed 
'OAUTH_REQENGINE_CURL'

Filename: Util/PeclOAuthHandler.php

Line Number: 142
A PHP Error was encountered

Severity: Warning

Message: OAuth::setRequestEngine() expects parameter 1 to be long, string given

Filename: Util/PeclOAuthHandler.php

Line Number: 142"

Can you help me out here?

Thanks,
Chirag

Original comment by chirag.e...@gmail.com on 10 May 2013 at 11:15

GoogleCodeExporter commented 8 years ago
Hi ,
i am getting this error

SoapFault Object ( [message:protected] => Unsupported Media Type 
[string:Exception:private] => [code:protected] => 0 [file:protected] => 
E:\wamp\www\testadwards\Google\Api\Ads\Common\Lib\AdsSoapClient.php 
[line:protected] => 179 [trace:Exception:private] => Array ( [0] => Array ( 
[file] => E:\wamp\www\testadwards\Google\Api\Ads\Common\Lib\AdsSoapClient.php 
[line] => 179 [function] => __doRequest [class] => SoapClient [type] => -> 
[args] => Array ( [0] => 
DQAAAMAAAAAxARLJcnZcT0CqSCacbauybykr-byHvPAMhrYFzUUJ7aTf2XsNlXhfu_CHn9cNNb8CYalV
LXWU0SGTDBPaA6a0dAZFcJd6sCX5VKBT1kLVXixI2byaXKr5kjFsdZUupORsQqfebkKE8KsafigszTmT
Or8DXtQYbiCHKDga_plqOsVcrBc2-TD5Y6vBcwwAXjBChXllXHQgTfCjbOiXP-pt5qN-BFxc0V9zXH8G
i_-PQPDeSsdifzJ5cWoKiUNbOUgnighatjabeen1989@gmail.com++USDINSERT_COMPANY_NAME_HE
RE (AwApi-PHP/5.0.0, Common-PHP/5.0.0, PHP/5.4.3) [1] => 
https://adwords.google.com//api/adwords/cm/v201302/CampaignService [2] => [3] 
=> 1 ) ) [1] => Array ( [file] => 
E:\wamp\www\testadwards\Google\Api\Ads\AdWords\Lib\AdWordsSoapClient.php [line] 
=> 85 [function] => __doRequest [class] => AdsSoapClient [type] => -> [args] => 
Array ( [0] => 
DQAAAMAAAAAxARLJcnZcT0CqSCacbauybykr-byHvPAMhrYFzUUJ7aTf2XsNlXhfu_CHn9cNNb8CYalV
LXWU0SGTDBPaA6a0dAZFcJd6sCX5VKBT1kLVXixI2byaXKr5kjFsdZUupORsQqfebkKE8KsafigszTmT
Or8DXtQYbiCHKDga_plqOsVcrBc2-TD5Y6vBcwwAXjBChXllXHQgTfCjbOiXP-pt5qN-BFxc0V9zXH8G
i_-PQPDeSsdifzJ5cWoKiUNbOUgnighatjabeen1989@gmail.com++USDINSERT_COMPANY_NAME_HE
RE (AwApi-PHP/5.0.0, Common-PHP/5.0.0, PHP/5.4.3) [1] => 
https://adwords.google.com//api/adwords/cm/v201302/CampaignService [2] => [3] 
=> 1 ) ) [2] => Array ( [function] => __doRequest [class] => AdWordsSoapClient 
[type] => -> [args] => Array ( [0] => 
DQAAAMAAAAAxARLJcnZcT0CqSCacbauybykr-byHvPAMhrYFzUUJ7aTf2XsNlXhfu_CHn9cNNb8CYalV
LXWU0SGTDBPaA6a0dAZFcJd6sCX5VKBT1kLVXixI2byaXKr5kjFsdZUupORsQqfebkKE8KsafigszTmT
Or8DXtQYbiCHKDga_plqOsVcrBc2-TD5Y6vBcwwAXjBChXllXHQgTfCjbOiXP-pt5qN-BFxc0V9zXH8G
i_-PQPDeSsdifzJ5cWoKiUNbOUgnighatjabeen1989@gmail.com++USDINSERT_COMPANY_NAME_HE
RE (AwApi-PHP/5.0.0, Common-PHP/5.0.0, PHP/5.4.3) [1] => 
https://adwords.google.com//api/adwords/cm/v201302/CampaignService [2] => [3] 
=> 1 [4] => 0 ) ) [3] => Array ( [file] => 
E:\wamp\www\testadwards\Google\Api\Ads\Common\Lib\AdsSoapClient.php [line] => 
200 [function] => __soapCall [class] => SoapClient [type] => -> [args] => Array 
( [0] => get [1] => Array ( [0] => CampaignServiceGet Object ( 
[serviceSelector] => Selector Object ( [fields] => [predicates] => [dateRange] 
=> [ordering] => [paging] => ) ) ) [2] => [3] => Array ( [0] => SoapHeader 
Object ( [namespace] => https://adwords.google.com/api/adwords/cm/v201302 
[name] => RequestHeader [data] => SoapRequestHeader Object ( [authToken] => 
DQAAAMAAAAAxARLJcnZcT0CqSCacbauybykr-byHvPAMhrYFzUUJ7aTf2XsNlXhfu_CHn9cNNb8CYalV
LXWU0SGTDBPaA6a0dAZFcJd6sCX5VKBT1kLVXixI2byaXKr5kjFsdZUupORsQqfebkKE8KsafigszTmT
Or8DXtQYbiCHKDga_plqOsVcrBc2-TD5Y6vBcwwAXjBChXllXHQgTfCjbOiXP-pt5qN-BFxc0V9zXH8G
i_-PQPDeSsdifzJ5cWoKiUNbOUg [clientCustomerId] => [developerToken] => 
nighatjabeen1989@gmail.com++USD [userAgent] => INSERT_COMPANY_NAME_HERE 
(AwApi-PHP/5.0.0, Common-PHP/5.0.0, PHP/5.4.3) [validateOnly] => 
[partialFailure] => ) [mustUnderstand] => ) ) [4] => Array ( ) ) ) [4] => Array 
( [file] => 
E:\wamp\www\testadwards\Google\Api\Ads\AdWords\v201302\CampaignService.php 
[line] => 6291 [function] => __soapCall [class] => AdsSoapClient [type] => -> 
[args] => Array ( [0] => get [1] => Array ( [0] => CampaignServiceGet Object ( 
[serviceSelector] => Selector Object ( [fields] => [predicates] => [dateRange] 
=> [ordering] => [paging] => ) ) ) ) ) [5] => Array ( [file] => 
E:\wamp\www\testadwards\index.php [line] => 15 [function] => get [class] => 
CampaignService [type] => -> [args] => Array ( [0] => Selector Object ( 
[fields] => [predicates] => [dateRange] => [ordering] => [paging] => ) ) ) ) 
[previous:Exception:private] => [faultstring] => Unsupported Media Type 
[faultcode] => HTTP [xdebug_message] => ( ! ) SoapFault: Unsupported Media Type 
in E:\wamp\www\testadwards\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 
179 Call Stack #TimeMemoryFunctionLocation 10.0244154880{main}( )..\index.php:0 
22.65661670304CampaignService->get( )..\index.php:15 
32.65661670640AdsSoapClient->__soapCall( )..\CampaignService.php:6291 )

Can you please tell me how to fix this??

Original comment by engr.har...@gmail.com on 20 May 2013 at 12:04

GoogleCodeExporter commented 8 years ago
Hi Chirag,

The AdWords API PHP Client Library no longer supports OAuth1.0.

Please consider migrating to OAuth2. For more information on how to migrate, 
the OAuth2 wiki page is a great place to start:
https://code.google.com/p/google-api-adwords-php/wiki/OAuth2

Regards,

- Paul, AdWords API Team.

Original comment by api.pmat...@gmail.com on 31 Jul 2013 at 4:26