服务例外

时间:2012-10-19 16:06:11

标签: youtube-api gdata gdata-api

我正在尝试使用带有GData for ObjectiveC的iPhone“已安装的应用程序”将视频上传到youtube。

目前我的上传机票收到错误:ServiceException - 错误代码500。

从文档中我无法弄清楚这个错误意味着什么以及我做错了什么:

  

500(内部错误) - 500响应代码表示YouTube   遇到处理请求的错误。您可以重试该请求   在以后的时间。

我只收到这个错误超过一周(所以这不是暂时的中断)我已尝试使用Youtube API的不同产品注册。

在我的请求中,有人能发现我做错了什么吗?

您可以在下面找到GData GTMHttpDebugLogs的日志:

uploadTicket:finishedWithEntry:error:

2012-10-18 17:13:26 +0000
Request: POST https://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads
Request headers:
  Accept: application/atom+xml, text/xml
  Authorization: AuthSub token=<authorization subtoken refreshed every time>
  Cache-Control: no-cache
  Content-Length: 793
  Content-Type: application/atom+xml; charset=utf-8
  GData-Version: 2.0
  Slug: video-filename.mp4
  User-Agent: <bundle>/2.0.0 GData-ObjectiveC/1.12 iPhone/5.1 (gzip)
  X-GData-Key: key=<my developer key
  X-Upload-Content-Length: 4005670
  X-Upload-Content-Type: video/mp4

Request body: (793 bytes)
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gml="http://www.opengis.net/gml" xmlns:app="http://www.w3.org/2007/app" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:media="http://search.yahoo.com/mrss/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:yt="http://gdata.youtube.com/schemas/2007"><yt:accessControl action="list"/><media:group><media:description>Video description here</media:description><media:keywords/><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Music</media:category><media:title>Video title here</media:title></media:group></entry>


Response: status 500
Response headers:
  Cache-Control: no-cache, no-store, must-revalidate
  Content-Length: 171
  Content-Type: application/vnd.google.gdata.error+xml
  Date: Thu, 18 Oct 2012 17:13:19 GMT
  Expires: Fri, 01 Jan 1990 00:00:00 GMT
  Pragma: no-cache
  Server: HTTP Upload Server Built on Oct 3 2012 16:52:30 (1349308350)
  X-GData-User-Country: US
  X-GUploader-UploadID: <### I made this upload id anonymous ###>

Response body: (171 bytes)
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>ServiceException</code><internalReason>Internal Error</internalReason></error></errors>
-----------------------------------------------------------

1 个答案:

答案 0 :(得分:0)

这是由您的请求中的<yt:accessControl action="list"/>引起的,这不是有效值。它应该类似于<yt:accessControl action='list' permission='denied'/>

话虽这么说,API应该优雅地处理它,而不是返回内部服务器错误。我会在内部向相关人员提交一个错误来解决这个问题。