KeywordPerformanceReport获取失败 [英] KeywordPerformanceReport fetching fails

查看:89
本文介绍了KeywordPerformanceReport获取失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JAVA访问BingAds API。从给定的endPoints通过WSDL2Java生成的类文件,例如

I'm using JAVA to access the BingAds API. The class files where generated via WSDL2Java from the given endPoints, for example

https://api.bingads.microsoft.com/Api/Advertiser/Reporting/V9/ReportingService .svc?wsdl

https://api.bingads.microsoft.com/Api/Advertiser/Reporting/V9/ReportingService.svc?wsdl

现在,我正在尝试获取KeywordPerfomanceReport,这里是使用过的代码的一部分:

now, i'm trying to fetch the KeywordPerfomanceReport, here a part of the used Code:

private ReportRequest buildAdKeywordPerformanceReportRequest(Calendar reportDate, MsAdcenterAccountConfig accountConfig)
	{
		KeywordPerformanceReportRequest report = new KeywordPerformanceReportRequest();
		report.setFormat(ReportFormat.Csv);
		report.setReportName("My Keyword Performance Report");
		report.setReturnOnlyCompleteData(true);
		report.setAggregation(ReportAggregation.Daily);

		report.setScope(new AccountThroughAdGroupReportScope());
		report.getScope().setAccountIds(new long[] { accountConfig.getAccountId() });

		report.getScope().setAdGroups(null);
		report.getScope().setCampaigns(null);
		ReportTime rt = new ReportTime();
		rt.setCustomDateRangeStart(calendarToMsDate(reportDate));
		rt.setCustomDateRangeEnd(calendarToMsDate(reportDate));
		rt.setPredefinedTime(null);
		report.setTime(rt);
		report.getTime().setCustomDateRangeStart(calendarToMsDate(reportDate));
		report.getTime().setCustomDateRangeEnd(calendarToMsDate(reportDate));

		report.setColumns(new KeywordPerformanceReportColumn[] { KeywordPerformanceReportColumn.TimePeriod, KeywordPerformanceReportColumn.AccountId,
																KeywordPerformanceReportColumn.CampaignId, KeywordPerformanceReportColumn.AdGroupId,
																KeywordPerformanceReportColumn.Keyword, KeywordPerformanceReportColumn.KeywordId,
																KeywordPerformanceReportColumn.DestinationUrl, KeywordPerformanceReportColumn.AdId,
																KeywordPerformanceReportColumn.DeviceType,
																KeywordPerformanceReportColumn.BidMatchType, KeywordPerformanceReportColumn.Clicks,
																KeywordPerformanceReportColumn.Impressions, KeywordPerformanceReportColumn.Ctr,
																KeywordPerformanceReportColumn.AverageCpc, KeywordPerformanceReportColumn.Spend,
																KeywordPerformanceReportColumn.QualityScore });

		return report;
	}

当我通过SubmitGenerateReport发送此请求时,我收到以下错误:

When i'm sending this Request via SubmitGenerateReport, i get following error:

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/v9:ReportRequest. The InnerException message was 'Error in line 1 position 3398. 'EndElement' 'CustomDateRangeEnd' from namespace 'https://bingads.microsoft.com/Reporting/v9' is not expected. Expecting element 'Day'.'.  Please see InnerException for more details.

我根本不理解它。 Fields CustomDateRangeEnd和CustomDateRangeStart在API和我生成的Java类中定义良好,但从未指定Field Day。

I don't understand it at all. The Fields CustomDateRangeEnd and CustomDateRangeStart are well defined in the API and in my generated Java classes, but a Field Day is never specified.

推荐答案

你好。

'日' ,'Month'和'Year'字段应分别位于CustomDateRangeStart和CustomDateRangeEnd元素中。请参阅 代码示例

here
。自定义日期范围代码已注释掉,您可以使用它而不是PredefinedTime设置。

The 'Day', 'Month', and 'Year' fields should each be within the CustomDateRangeStart and CustomDateRangeEnd elements. Please refer to the code example here. The custom date range code is commented out, and you can use it instead of the PredefinedTime setting.

如果您仍然被屏蔽,请使用您的SOAP请求(不需要凭据)进行升级,我们会进一步调查。

If you are still blocked, please escalate with your SOAP request (without credentials) and we will investigate further.

我希望这有帮助!


这篇关于KeywordPerformanceReport获取失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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