我正在使用 Zend_Gdata_Photos PHP 客户端访问 Google Picasa API,尝试做一些非常简单的事情,列出所有相册,然后列出每个相册中的所有照片。这是我的代码:
$client = Zend_Gdata_ClientLogin::getHttpClient('*****', '*****', Zend_Gdata_Photos::AUTH_SERVICE_NAME);
$gp = new Zend_Gdata_Photos($client);
$userFeed = $gp->getUserFeed('default');
foreach ($userFeed as $albumEntry) {
echo "<h2>{$albumEntry->title->text} ({$albumEntry->id->text})</h2>";
$albumFeed = $gp->getAlbumFeed($albumEntry->id->text);
foreach ($albumFeed as $photoEntry) {
echo "{$photoEntry->title->text}<br>";
}
}
当它运行时,我从 $gp->getAlbumFeed(...) 行得到这个异常:
Zend_Gdata_App_Exception: No root element
想法是我做错了什么?