6 messages in com.googlegroups.google-base-data-apiRe: did something change?
FromSent OnAttachments
lozi...@gmail.com18 Mar 2008 13:16 
lozi...@gmail.com19 Mar 2008 08:46 
lozi...@gmail.com19 Mar 2008 10:39 
Dal...@ PBPost19 Mar 2008 15:04 
lozi...@gmail.com20 Mar 2008 06:19 
Dal...@ PBPost26 Mar 2008 10:26 
Subject:Re: did something change?
From:Dal...@ PBPost (thep@gmail.com)
Date:03/19/2008 03:04:57 PM
List:com.googlegroups.google-base-data-api

Hi Aaron,

Because the "image_link" attribute is what is causing your exception, this issue may be linked to the same issue I am having. I am catching the "reason" that is coming back in the xml response from the googebase API and it is giving me "There was a problem finding the specified image" ... although I know that the images are there. This happens no matter which image is being used.

A quick work-around for me was to remove the "image_link" attribute and send the item without an image preview. Although this sucks, at least the items make it onto Googlebase.

You can see my thread here http://groups.google.com/group/Google-Base-data-API/browse_thread/thread/083cab6618b4c67f# .

Good luck.

Dale

On Mar 19, 1:39 pm, "lozi@gmail.com" <lozi@gmail.com> wrote:

It is the image_link attribute that is causing it to fail.  Even something as straightforward as this will break the insert:

$newEntry->addGbaseAttribute('image_link',
'https://www.strollersdirect.com/images/lg_image/prod-5.jpg', 'url');

Again, this worked three weeks ago.

Thanks!

Aaron

On Mar 19, 10:46 am, "lozi@gmail.com" <lozi@gmail.com> wrote:

Here is the function I am using to generate the feed.  I am sparing you guys the includes and the accessory functions, which came straight from the download off Zend's website.  But if anyone needs to see more I am happy to oblige.

[code] function processPageLoad() {         global $_SESSION, $_GET;         $num_items = 0;         startHTML();         $service = Zend_Gdata_Gbase::AUTH_SERVICE_NAME;         $email = 'xxxxxxxxxxx';         $passwd = 'xxxxxxxxxxx';

        try {            $client = Zend_Gdata_ClientLogin::getHttpClient($email, $passwd, $service);         } catch (Zend_Gdata_App_CaptchaRequiredException $cre) {                 echo 'URL of CAPTCHA image: ' . $cre->getCaptchaUrl() . "\n";                 echo 'Token ID: ' . $cre->getCaptchaToken() . "\n";                 exit;         } catch (Zend_Gdata_App_AuthException $ae) {            echo 'Problem authenticating: ' . $ae->exception() . "\n";            exit;         }

        $query = "SELECT p.productname,p.long_desc,p.sale_price,p.weight,p.SKU,p.UPC,p.product_ID,p.­page_URL,p.lg_image,p.num_in_stock,p.active_stock,m.manufacturer_name FROM products p INNER JOIN manufacturers m on p.manufacturer_ID = m.manufacturer_ID WHERE gbase = 1 LIMIT 10";         $rs = mysql_query($query) or die(mysql_error());         while($row=mysql_fetch_array($rs,MYSQL_ASSOC)){

                $service = new Zend_Gdata_Gbase($client);                 $newEntry = $service->newItemEntry();

                // Add title                 $newEntry->title =
$service->newTitle(trim($row['productname']));

                // Add some content                 $content = strip_tags(nl2br($row['long_desc']));

                $content = "This is a sample description";                 $newEntry->content = $service->newContent($content);                 $newEntry->content->type = 'text';

                // Define product type                 $itemType = "Products";                 $newEntry->itemType = $itemType;                 $newEntry->itemType->type = 'text';

                // Add item-specific attributes                 $newEntry->addGbaseAttribute('product_type', 'baby gear',
'text');                 $newEntry->addGbaseAttribute('price', $row['sale_price'].' USD', 'floatUnit');

                $newEntry->addGbaseAttribute('brand', $row['manufacturer_name'], 'text');                 $newEntry->addGbaseAttribute('weight', $row['weight'].' lbs', 'numberUnit');

                $newEntry->addGbaseAttribute('mpn', $row['SKU'], 'text');                 $newEntry->addGbaseAttribute('condition', 'New', 'text');                 $newEntry->addGbaseAttribute('UPC', $row['UPC'], 'text');

                $newEntry->addGbaseAttribute('image_link',
'http://www.strollersdirect.com/images/lg_image/'.$row['lg_image'], 'url');                 $newEntry->addGbaseAttribute('id', $row['product_ID'], 'text');

                if ($row['active_stock']==1&&$row['num_in_stock']>0){                         $newEntry->addGbaseAttribute('quantity',
($row['num_in_stock']+5), 'int');                 } else {                         $newEntry->addGbaseAttribute('quantity', 5, 'int');                 }

                $newLink = new Zend_Gdata_App_Extension_Link();                 $newLink->setHref('http://www.strollersdirect.com/'. $row['page_URL'].'.htm');                         $debug .=
'$newLink->setHref(\'http://www.strollersdirect.com/\''. $row['page_URL'].'\'.htm\');';                 $newLink->setRel('alternate');                 $newLink->setType('text/html');

                $linkArray = $newEntry->getLink();                 $linkArray[] = $newLink;

                $newEntry->setLink($linkArray);

                // Post the item                 try {                         $createdEntry = $service->insertGbaseItem($newEntry,
$dryRun);                         echo '[success] product_id:'.$row['product_ID'].'<hr
/>';;                         $num_items++;                 }                 catch(Exception $e){                         echo '<span style="color: red;">[error] product_id:'. $row['product_ID'].' - ['.$e.']</span><hr />';                         $num_errors++;                 }                 echo '<br />';

        }

        echo '<br />'.$num_items.' successfully uploaded.  '.$num_errors.' errors.<br />';

        endHTML();}

[/code]

This is the error I am getting:

[exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400' in /var/www/ZendGdata-1.0.3/library/Zend/ Gdata/App.php:467 Stack trace: #0 /var/www/ZendGdata-1.0.3/library/ Zend/Gdata/App.php(662):
Zend_Gdata_App->post(Object(Zend_Gdata_Gbase_ItemEntry), 'http://www.goog...')
#1 /

var/www/ZendGdata-1.0.3/library/Zend/Gdata/Gbase.php(149): Zend_Gdata_App->insertEntry(Object(Zend_Gdata_Gbase_ItemEntry), 'http://www.goog...', 'Zend_Gdata_Gbas...') #2 /var/www/ acropolis_source_code/admin/products-googlebase.php(127): Zend_Gdata_Gbase->insertGbaseItem(Object(Zend_Gdata_Gbase_ItemEntry), NULL) #3 /var/www/acropolis_source_code/admin/products- googlebase.php(9): processPageLoad() #4 /var/www/strollers/public_html/ admin/index.php(4): require('/var/www/acropo...') #5 {main}]

And I am not sure how I can post the information that is in the tables, but what I will say is this function was working perfectly as of March 5th.  It was only when I went in yesterday to set the script up on a cron job that I realized it no longer worked.  Please help if you can!

Thanks,

Aaron Lozier- Hide quoted text -

- Show quoted text -