PHP 7 Bing Ads api - formatter抛出错误 [英] PHP 7 Bing Ads api - formatter threw error

查看:61
本文介绍了PHP 7 Bing Ads api - formatter抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误如下:

"格式化程序在尝试反序列化消息时引发异常:尝试反序列化参数https:// bingads时出错.microsoft.com /报告/ V11:的ReportRequest。 InnerException消息是"无效的枚举值"CampaignId'
无法反序列化为"Microsoft.AdCenter.Advertiser.Reporting.Api.DataContracts.Enum.AccountPerformanceReportColumn"类型。确保存在必要的枚举值,并且如果类型具有DataContractAttribute
属性,则使用EnumMemberAttribute属性标记。'。 有关详细信息,请参阅InnerException。

https://clientcenter.api.sandbox.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService.svc?singleWsdl"

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://bingads.microsoft.com/Reporting/v11:ReportRequest. The InnerException message was 'Invalid enum value 'CampaignId' cannot be deserialized into type 'Microsoft.AdCenter.Advertiser.Reporting.Api.DataContracts.Enum.AccountPerformanceReportColumn'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.
https://clientcenter.api.sandbox.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService.svc?singleWsdl"

注入到提交报告的函数的报告的php var_dump是

php var_dump of report injected to function that submits report is

对象(SoapVar)#494(4){

  [" enc_type"] =>

  int(301)

  [" enc_value"] =>

  object(Microsoft \ BangAds\V11 \Reporting\AudiencePerformanceReportRequest)#493(12){

    [" Aggregation"] =>

    string(5)" Daily"

    [" Columns"] =>

    array(9){

      [0] =>

      string(10)" TimePeriod"

      [1] =>

      string(9)" AccountId"

      [2] =>

      string(10)" CampaignId"

      [3] =>

      string(10)" AudienceId"

      [4] =>

      string(6)" Clicks"

      [5] =>

      string(11)" Impressions"

      [6] =>

      string(3)" Ctr"

      [7] =>

      string(10)" AverageCpc"

      [8] =>
$
      string(5)"花费"

    }
    [" Filter"] =>

    NULL

    ["范围"] =>

    object(Microsoft \BingAds \V11 \Reporting\AccountThroughAdGroupReportScope)#495(3){

      [" AccountIds"] =>

      array(1){

        [0] =>

        int(00000000)

      }
      [" AdGroups"] =>

      NULL

      [" Campaigns"] =>

      string(9)" 861731927" < - 将此添加到调试试用w / o它也是
    }
    [" Time"] =>

    object(Microsoft \BingAds\V11 \Reporting\ReportTime)#496(3){

      [" CustomDateRangeEnd"] =>

      NULL

      [" CustomDateRangeStart"] =>

      NULL

      [" PredefinedTime"] =>

      string(9)" LastMonth"

    }
    [" ExcludeColumnHeaders"] =>

    NULL

    [" ExcludeReportFooter"] =>

    NULL

    [" ExcludeReportHeader"] =>
$
    NULL

    ["格式"] =>

    string(3)" Tsv"

    [" Language"] =>

    NULL

    [" ReportName"] =>

   字符串(27)"受众群体效果报告"

    [" ReturnOnlyCompleteData"] =>

    bool(false)

  }¥b $ b  [" enc_stype"] =>

  string(31)" AccountPerformanceReportRequest"

  [" enc_ns"] =>

  string(43)" https://guideads.microsoft.com/Reporting/v11"

}

object(SoapVar)#494 (4) {
  ["enc_type"]=>
  int(301)
  ["enc_value"]=>
  object(Microsoft\BingAds\V11\Reporting\AudiencePerformanceReportRequest)#493 (12) {
    ["Aggregation"]=>
    string(5) "Daily"
    ["Columns"]=>
    array(9) {
      [0]=>
      string(10) "TimePeriod"
      [1]=>
      string(9) "AccountId"
      [2]=>
      string(10) "CampaignId"
      [3]=>
      string(10) "AudienceId"
      [4]=>
      string(6) "Clicks"
      [5]=>
      string(11) "Impressions"
      [6]=>
      string(3) "Ctr"
      [7]=>
      string(10) "AverageCpc"
      [8]=>
      string(5) "Spend"
    }
    ["Filter"]=>
    NULL
    ["Scope"]=>
    object(Microsoft\BingAds\V11\Reporting\AccountThroughAdGroupReportScope)#495 (3) {
      ["AccountIds"]=>
      array(1) {
        [0]=>
        int(00000000)
      }
      ["AdGroups"]=>
      NULL
      ["Campaigns"]=>
      string(9) "861731927" <- added this to debug tried w/o it also
    }
    ["Time"]=>
    object(Microsoft\BingAds\V11\Reporting\ReportTime)#496 (3) {
      ["CustomDateRangeEnd"]=>
      NULL
      ["CustomDateRangeStart"]=>
      NULL
      ["PredefinedTime"]=>
      string(9) "LastMonth"
    }
    ["ExcludeColumnHeaders"]=>
    NULL
    ["ExcludeReportFooter"]=>
    NULL
    ["ExcludeReportHeader"]=>
    NULL
    ["Format"]=>
    string(3) "Tsv"
    ["Language"]=>
    NULL
    ["ReportName"]=>
    string(27) "Audience Performance Report"
    ["ReturnOnlyCompleteData"]=>
    bool(false)
  }
  ["enc_stype"]=>
  string(31) "AccountPerformanceReportRequest"
  ["enc_ns"]=>
  string(43) "https://bingads.microsoft.com/Reporting/v11"
}

样本报告看起来是一样但提交成功了

the sample report looks the same but submiting it is successful

是什么导致这种情况?

推荐答案

发现错误,报告名称和enc_stype是不同的
Found error, reportname and enc_stype was different


这篇关于PHP 7 Bing Ads api - formatter抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆