报告序列化错误

编程入门 行业动态 更新时间:2024-10-27 18:24:03
本文介绍了报告序列化错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试实现BingAds API v11以在python中下载报告。

I am trying to implement the BingAds API v11 to pull down a report in python.

我收到错误:

服务器引发的错误:'格式化程序在尝试反序列化

Server raised fault: 'The formatter threw an exception while trying to deserialize the

消息时抛出异常:尝试反序列化参数时出错

message: There was an error while trying to deserialize parameter

bingads.microsoft/Reporting/v9:ReportRequest。

bingads.microsoft/Reporting/v9:ReportRequest.

InnerException消息是'第1行第1820位错误。元素

The InnerException message was 'Error in line 1 position 1820. Element

'bingads.microsoft/Reporting/v9:ReportRequest'包含来自某种类型的数据映射到名称

'bingads.microsoft/Reporting/v9:ReportRequest' contains data from a type that maps to the name

'bingads.microsoft/Reporting/v11:BudgetSummaryReportRequest'。反序列化器不知道映射到此名称的任何类型的

'bingads.microsoft/Reporting/v11:BudgetSummaryReportRequest'. The deserializer has no knowledge

。如果您正在使用

DataContractSerializer或将与'BudgetSummaryReportRequest'

DataContractSerializer or add the type corresponding to 'BudgetSummaryReportRequest'

对应的类型添加到已知类型列表中,请考虑使用DataContractResolver - 例如,通过使用KnownTypeAttribute属性或添加它传递给传递给序列化程序的已知类型的

to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the

列表。有关详细信息,请参阅InnerException。'

list of known types passed to the serializer.'. Please see InnerException for more details.'

无论我请求的报告类型是什么,都会出现此错误,但我无法弄清楚我的遗漏内容请求。这是SOAP客户端日志:

This error comes through regardless of what type of report I request, but I can't figure out what's missing from my request. Here is the SOAP client log:

推荐答案

您好。

我注意到您在同一请求中混合了v9和v11:

I noticed that you are mixing v9 and v11 in the same request:

DEBUG:suds.client:发送到(reporting.api.bingads.microsoft。 com / Api / Advertiser / Reporting / V9 /ReportingService.svc) 消息: <?xml ve rsion = QUOT; 1.0" encoding =" UTF-8"?> < SOAP-ENV:Envelope xmlns:ns3 =" schemas.xmlsoap/soap/envelope/"的xmlns:TNS = QUOT; HTTPS://bingads.microsoft/Reporting/的 V9 " xmlns:ns0 =" schemas.microsoft/2003/10/Serialization/Arrays"的xmlns:NS1 = QUOT; HTTPS://bingads.microsoft/Reporting/的 V9 "的xmlns:ns2的= QUOT; HTTPS://bingads.microsoft/Reporting/的 V11 "的xmlns:的xsi = QUOT; HTTP://www.w3/2001/XMLSchema-instance" xmlns:SOAP-ENV =" schemas.xmlsoap/soap/envelope/">

DEBUG:suds.client:sending to (reporting.api.bingads.microsoft/Api/Advertiser/Reporting/V9/ReportingService.svc) message: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:ns3="schemas.xmlsoap/soap/envelope/" xmlns:tns="bingads.microsoft/Reporting/v9" xmlns:ns0="schemas.microsoft/2003/10/Serialization/Arrays" xmlns:ns1="bingads.microsoft/Reporting/v9" xmlns:ns2="bingads.microsoft/Reporting/v11" xmlns:xsi="www.w3/2001/XMLSchema-instance" xmlns:SOAP-ENV="schemas.xmlsoap/soap/envelope/">

您是否更新过使用bingads.v11.reporting ?如果你有最新的SDK,这个样本应该可以使用(取消预算报告):

Have you updated to use bingads.v11.reporting? If you have the latest SDK this sample should work (uncomment for the budget report):

github/BingAds/BingAds-Python-SDK/blob/master/examples/BingAdsPythonConsoleExamples/BingAdsPythonConsoleExamples/v11/report_requests.py #L23

我希望这有帮助!

更多推荐

报告序列化错误

本文发布于:2023-10-25 14:33:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1527234.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   序列化   报告

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!