4

我正在使用 201306,直到星期五我都可以正常下载报告。但是今天突然开始出现以下错误。

Invalid ReportDefinition Xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'operator'

我的代码片段:

 selector.fields = new[]
                    {
                        PerformanceSelector.Date,
                        PerformanceSelector.KeywordId,
                        PerformanceSelector.KeywordText,
                        PerformanceSelector.AccountName,
                        PerformanceSelector.CampaignId,
                        PerformanceSelector.CampaignName,
                        PerformanceSelector.AdGroupId,
                        PerformanceSelector.AdGroupName,
                        PerformanceSelector.KeywordMatchType,
                        PerformanceSelector.Impressions,
                        PerformanceSelector.Clicks,
                        PerformanceSelector.AveragePosition,
                        PerformanceSelector.Cost,
                        PerformanceSelector.AverageCpc,
                        PerformanceSelector.ClickThroughRate,
                        PerformanceSelector.Conversions,
                        PerformanceSelector.ConversionRate,
                        PerformanceSelector.CostPerConversion,
                    };

                    dates = new DateRange { min = String.Format("{0:yyyyMMdd}", StartDate), max = String.Format("{0:yyyyMMdd}", EndDate) };
                    selector.dateRange = dates;

报告定义

    var reportDefinition = new ReportDefinition
        {
            reportName = ReportName,
            reportType = ReportType,
            dateRangeType = ReportDefinitionDateRangeType.CUSTOM_DATE,
            includeZeroImpressions = true,
            downloadFormat = DownloadFormat.XML,
            selector = selector
        };

我得到的错误是

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.INVALID_REPORT_DEFINITION_XML</type><trigger>Invalid ReportDefinition Xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'operator'. One of '{&quot;https://adwords.google.com/api/adwords/cm/v201306&quot;:field}' is expected.</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>
4

1 回答 1

3

我也有这个问题,但是忘记改版本了:

var utility = new ReportUtilities(user); 实用程序.ReportVersion = "v201309";

还是v201302

希望这可以帮助。

斯蒂芬妮

于 2013-12-03T17:08:32.593 回答