首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >调用AdexchangebuyerService.Creatives.List时Google.Apis.Adexchangebuyer.v13中的GoogleApiException

调用AdexchangebuyerService.Creatives.List时Google.Apis.Adexchangebuyer.v13中的GoogleApiException
EN

Stack Overflow用户
提问于 2015-04-25 12:43:33
回答 1查看 309关注 0票数 0

当呼叫具有高数字(> 20 )创造性ids的列表时,我收到此异常。当呼叫列表大约有10个创意时,它工作得很好,每次呼叫大约需要30秒。

以下是异常详细信息:

代码语言:javascript
运行
复制
Google.GoogleApiException was caught HResult=-2146233088 Message=Google.Apis.Requests.RequestError Backend Error [500] Errors [ Message[Backend Error] Location[ - ] Reason[backendError] Domain[global] ]

Source=Google.Apis ServiceName=adexchangebuyer StackTrace: at Google.Apis.Requests.ClientServiceRequest`1.Execute() in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\test\default\Src\GoogleApis\Apis\Requests\ClientServiceRequest.cs:line 102 InnerException:

这是使用Google.Apis.AdExchangeBuyer.v1_3 1.9.0.48的调用代码:(我也尝试使用1.9.0.51)

代码语言:javascript
运行
复制
    var listRequest = this.AdexchangebuyerService.Creatives.List();
    listRequest.MaxResults = 1000;
    listRequest.BuyerCreativeId = new Repeatable<string>(creativeIds ); 
    // creativeIds is IEnumerable<string>; (fails with 20 creative ids, passes with 10)
    var listOfCreatives = listRequest.Execute(); // -- exception thrown here

使用客户端库在fiddler中捕获的请求:

代码语言:javascript
运行
复制
GET https://www.googleapis.com/adexchangebuyer/v1.3/creatives?key={YOUR_API_KEY}&pageToken=mypa‌​getoken&maxResults=1000&buyerCreativeId=i7bhb44u&buyerCreativeId=f5bfbul2 
HTTP/1.1 
User-Agent: AdExchangeBuyer google-api-dotnet-client/1.9.1.12394 (gzip)

这是使用web界面(https://developers.google.com/ad-exchange/buyer-rest/v1.3/creatives/list)的请求:

代码语言:javascript
运行
复制
GET https://www.googleapis.com/adexchangebuyer/v1.3/creatives?buyerCreativeId=i7bhb44u&buyerCreativeId=f5bfbul2&key={YOUR_API_KEY}
EN

回答 1

Stack Overflow用户

发布于 2015-04-26 23:03:06

看起来调用时间太长了,您可能会超时。因此,我建议您尝试以下方法之一:

  1. 如果您有超过x个(在您的情况下是10个)项,则将其拆分为多个调用。看起来对于10个项目,它花费的时间超过20秒,所以你可以拆分它,并且你不会得到一些超过默认数字的默认超时(我在某个地方读到的是100秒,但我在官方文档-https://msdn.microsoft.com/en-us/library/system.net.http.httpclient.timeout%28v=vs.118%29.aspx中没有找到它)。您可以执行以下操作:

this.AdexchangebuyerService.HttpClient.Timeout = TimeSpan.FromSeconds(200);

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29861101

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档