dcm api致命错误:在null上调用成员函数insert()

时间:2018-01-15 17:02:33

标签: php google-app-engine google-api google-api-php-client google-apis-explorer

我试图执行此代码

$startDate = new DateTime("2018-01-15", new DateTimeZone('America/New_York'));
$endDate = new DateTime("2018-01-16", new DateTimeZone('America/New_York'));

$AdvertiserId="4103310";
$DefaultLandingPageId="8925159";
$Name="2018|Q1|TESTapp|FRA";

$campaign = new Google_Service_Dfareporting_Campaign();
$campaign->setAdvertiserId($AdvertiserId);
$campaign->setDefaultLandingPageId($DefaultLandingPageId);
$campaign->setName($Name);
$campaign->setStartDate($startDate->format('Y-m-d'));
$campaign->setEndDate($endDate->format('Y-m-d'));

$userProfileId = '3177467';

//call api dcm

$result = $service->campaigns->insert(
$values[$userProfileId], 
$campaign
);

$startDate = new DateTime("2018-01-15", new    DateTimeZone('America/New_York'));
$endDate = new DateTime("2018-01-16", new DateTimeZone('America/New_York'));
$AdvertiserId="4103310";
$DefaultLandingPageId="8925159";
$Name="2018|Q1|TESTapp|FRA";
$campaign = new Google_Service_Dfareporting_Campaign();
$campaign->setAdvertiserId($AdvertiserId);
$campaign->setDefaultLandingPageId($DefaultLandingPageId);
$campaign->setName($Name);
$campaign->setStartDate($startDate->format('Y-m-d'));
$campaign->setEndDate($endDate->format('Y-m-d'));
$userProfileId = '3177467';
//call api dcm
$result = $service->campaigns->insert(
$values[$userProfileId], 
$campaign
);

当我在wamp中启动此代码时,我有以下错误消息

  

"致命错误:在null中调用成员函数insert()   第123行"

中的C:\ wamp64 \ www \ scripts \ apptest3.php

我该如何调试此错误?

0 个答案:

没有答案