【发布时间】:2014-12-25 01:51:55
【问题描述】:
我正在使用 PicasaWeb 上的上传功能在 Google App Engine 上开发一个网络应用程序。 我使用此代码上传照片:
myService = new PicasawebService("my-picasa-web-service");
myService.setConnectTimeout(60000);
myService.setReadTimeout(60000);
myService.setUserCredentials(USERNAME, PASSWORD);
PhotoEntry myPhoto = new PhotoEntry();
myPhoto.setClient("myAdminClient");
MediaStreamSource myMedia = new MediaStreamSource(stream, "image/jpeg");
myPhoto.setMediaSource(myMedia);
PhotoEntry returnedPhoto = myService.insert(new URL(albumFeedUrl), myPhoto);
其中 stream 变量是带有上传文件的 InputStream。
如果我在独立的客户端程序中运行此代码,它就可以工作。 但是当我使用 GAE 最后一行 raise 和 exception 运行它时,我可以在日志中看到这一点:
com.google.gdata.util.InvalidEntryException: OK
<HTML>
<HEAD>
<TITLE>Bad Request</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Bad Request</H1>
<H2>Error 400</H2>
</BODY>
</HTML>
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:602)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.media.MediaService.insert(MediaService.java:400)
你能帮我解决这个错误吗?
我怎样才能获得有关此的更多信息?
谢谢 斯特凡诺
【问题讨论】:
-
不知道这个问题?
标签: google-app-engine sdk gdata picasa