【问题标题】:Adwords API ReportDefinitionService: ReportDefinition not foundAdwords API ReportDefinitionService:未找到 ReportDefinition
【发布时间】:2016-12-14 02:39:13
【问题描述】:

如果我这样做:

$user->GetService('ManagedCustomerService');
$customer = new \ManagedCustomer();

这可行,但如果我这样做:

$user->LoadService('ReportDefinitionService');
$report = new \ReportDefinition();

我收到一个错误:找不到类“ReportDefinition”。 (我写在 Yii2 上,使用 api v201607)

我做错了什么?

===========修复==================

我通过添加临时使其工作:

require_once dirname(dirname(dirname(__FILE__))) . '/vendor/googleads/googleads-php-lib/examples/AdWords/v201607/init.php';
require_once ADWORDS_UTIL_VERSION_PATH . '/ReportUtils.php';

【问题讨论】:

标签: php namespaces yii2 google-ads-api classnotfound


【解决方案1】:

自 API 版本 v201109 起,您无法使用 ReportDefinitionService 创建报告。请改用ad-hoc reports

【讨论】:

  • 命名空间 ReportDefinition 的问题 - 与加载服务无关。在示例文件夹中,此代码运行良好。
  • 我的错——以前(在临时报告之前),ReportDefinitionService 的 WSDL 中有一个 SOAP 类型 ReportDefinition。我以为你正在尝试使用那种类型。无视我的回答。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-09
  • 1970-01-01
  • 2013-02-12
  • 2014-05-23
相关资源
最近更新 更多