Hi Sebastian,

I'm afraid that you might use the utility in a wrong way so you're faced 
with the issue.
The most likely cause would be that you've done *require_once* of many 
classes including those from services, e.g., *CampaignService.php*, which 
in turn includes ApiError 
<https://github.com/googleads/googleads-php-lib/blob/deprecated/src/Google/Api/Ads/AdWords/v201609/CampaignService.php#L41>
.
But that ApiError 
<https://github.com/googleads/googleads-php-lib/blob/deprecated/src/Google/Api/Ads/AdWords/v201609/CampaignService.php#L41>
 
is different from the reporting one 
<https://github.com/googleads/googleads-php-lib/blob/deprecated/src/Google/Api/Ads/AdWords/Util/v201609/ReportClasses.php#L37>
 
in that it doesn't have *$type* 
<https://github.com/googleads/googleads-php-lib/blob/deprecated/src/Google/Api/Ads/AdWords/Util/v201609/ReportClasses.php#L55>
.
Thus, when you call the deserializer, it crashes because it can't find such 
a member variable.
Please see similar case here 
<https://github.com/googleads/googleads-php-lib/issues/147#issuecomment-259393875>
.

We're happy to help in this forum, but we would appreciate more if you 
could ask library-related questions on GitHub, so other users can see as 
well. :-)
Please let me know if anything is still not clear.

Best,
Thanet, AdWords API Team

On Saturday, December 24, 2016 at 12:11:28 AM UTC+9, Sebastian Piskorski 
wrote:
>
> If I add such line early in the script:
>
> require_once 'Google/Api/Ads/AdWords/Util/v201605/ReportUtilsDelegate.php'
> ;
>
> the XML will be parsed properly and I get ReportDownloadException. But if 
>  I only define a version with:
>
> /** @var \AdWordsUser $this->client */
> $this->client->GetService('ReportDefinitionService', 'v201605');
>
> and then later
>
> (new \ReportUtils())->DownloadReport($reportDefinition, null, $this->
> client, $options);
>
> Then I get ReflectionExcetion.
>
>
>
> On Friday, December 23, 2016 at 3:21:20 PM UTC+1, Sebastian Piskorski 
> wrote:
>>
>> If you run:
>>
>> (new \XmlDeserializer(\ReportUtilsDelegate::$CLASS_MAP))->
>> ConvertXmlToObject($responseXml);
>>
>> with following XML:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <reportDownloadError><ApiError><type>
>> AuthenticationError.OAUTH_TOKEN_INVALID</type><trigger>&lt;null&gt;
>> </trigger><fieldPath></fieldPath></ApiError></reportDownloadError>
>>
>> which is response from AdWords API endpoint. Then it will throw:
>>
>> ReflectionException('Porperty  does not exist');
>>
>> Code is run by default when handling API response other than 200 
>> at ReportUtilsDelegate.php line 164 and crashes at XmlDeserializer.php line 
>> 144. 
>>
>> I'm using API v201605 .
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a52b0d4c-8dee-4d91-944e-f5331934d1d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Bug ... Sebastian Piskorski
    • ... Sebastian Piskorski
    • ... Sebastian Piskorski
      • ... 'Thanet Knack Praneenararat (AdWords API Team)' via AdWords API Forum

Reply via email to