dongqiangse6623 2017-03-10 14:51
浏览 32

类型“ns1:预算”未有效地从元素'ns1:operand'的类型定义'Campaign'派生

Using this package for laravel: https://github.com/nikolajlovenhardt/laravel-google-ads

When i try to write a campaign, the following error occur:

SoapFault in AdsSoapClient.php line 115: Unmarshalling Error: cvc-elt.4.3: Type 'ns1:Budget' is not validly derived from the type definition, 'Campaign', of element 'ns1:operand'.

soap.log: http://pastebin.com/raw/TmU6XSfp

[2017-03-10 14:33:57] AW_SOAP.INFO: clientCustomerId=556-905-2150 operations=1 service=BudgetService method=mutate responseTime=145 requestId=00054a61407809890a378107c00d151f server=adwords.google.com isFault=0 faultMessage= [2017-03-10 14:33:58] AW_SOAP.WARNING: clientCustomerId=556-905-2150 operations= service=CampaignService method=mutate responseTime= requestId= server=adwords.google.com isFault=1 faultMessage=Unmarshalling Error: cvc-elt.4.3: Type 'ns1:Budget' is not validly derived from the type definition, 'Campaign', of element 'ns1:operand'. [2017-03-10 14:33:58] AW_SOAP.NOTICE: POST /api/adwords/cm/v201609/CampaignService?wsdl HTTP/1.1 Host: adwords.google.com Connection: Keep-Alive User-Agent: PHP-SOAP/7.1.2-3+deb.sury.org~xenial+1 Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 1436 Authorization: REDACTED

556-905-2150REDACTEDunknown (AwApi-PHP, googleads-php-lib/25.2.0, PHP/7.1.2-3+deb.sury.org~xenial+1)falsefalseADDInterplanetary Cruise Budget

58c2b955417e250000000STANDARDADDInterplanetary Cruise

58c2b955cc997PAUSED1050511653DISPLAYMANUAL_CPC

HTTP/1.1 500 Internal Server Error Content-Type: text/xml; charset=UTF-8 Date: Fri, 10 Mar 2017 14:33:58 GMT Expires: Fri, 10 Mar 2017 14:33:58 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Server: GSE Alt-Svc: quic=":443"; ma=2592000; v="36,35,34" Accept-Ranges: none Vary: Accept-Encoding Transfer-Encoding: chunked

soap:ClientUnmarshalling Error: cvc-elt.4.3: Type 'ns1:Budget' is not validly derived from the type definition, 'Campaign', of element 'ns1:operand'.

Copied from the "Basic Operations Samples"

$customerClientId = 'xxx-xxx-xxxx';

$adWordsService = new AdWordsService();

/** @var BudgetService $budgetService */
$budgetService = $adWordsService->getService(BudgetService::class, $customerClientId);

// Create the shared budget (required).
$budget = new Budget();
$budget->setName('Interplanetary Cruise Budget #' . uniqid());
$money = new Money();
$money->setMicroAmount(50000000);
$budget->setAmount($money);
$budget->setDeliveryMethod(BudgetBudgetDeliveryMethod::STANDARD);

$operations = [];

// Create a budget operation.
$operation = new BudgetOperation();
$operation->setOperand($budget);
$operation->setOperator(Operator::ADD);
$operations[] = $operation;

// Create the budget on the server.
$result = $budgetService->mutate($operations);
$budget = $result->getValue()[0];

// Create a campaign with only required settings.
$campaign = new Campaign();
$campaign->setName('Interplanetary Cruise #' . uniqid());
$campaign->setAdvertisingChannelType(AdvertisingChannelType::DISPLAY);

// Set shared budget (required).
$campaign->setBudget(new Budget());
$campaign->getBudget()->setBudgetId($budget->getBudgetId());

// Set bidding strategy (required).
$biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$biddingStrategyConfiguration->setBiddingStrategyType(
        BiddingStrategyType::MANUAL_CPC);
$campaign->setBiddingStrategyConfiguration($biddingStrategyConfiguration);

$campaign->setStatus(CampaignStatus::PAUSED);

// Create a campaign operation and add it to the operations list.
$operation = new CampaignOperation();
$operation->setOperand($campaign);
$operation->setOperator(Operator::ADD);
$operations[] = $operation;

/** @var CampaignService $campaignService */
$campaignService = $adWordsService->getService(CampaignService::class, $customerClientId);

$result = $campaignService->mutate($operations);

foreach ($result->getValue() as $campaign) {
    printf("Campaign with name '%s' and ID %d was added.
",
        $campaign->getName(),
        $campaign->getId()
    );
}

Receiving campaigns with the sample code works...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度