views:

115

answers:

0

Hi All,

I have been trying for hours to get this working and I still have had no joy. Basically I am trying to connect to Google Base using the GData library built into Zend Framework 1.9. I have cut my example right down the nothing, just to get it working. All I am trying to do for the sake of the example is simply connect and insert one item. However each time I get the response (Message: Expected response code 200, got 404).

If anyone could point out where I'm going wrong that would be a big help!

The code I am using is taken from here ZF Example GData:

// Parameters for ClientAuth authentication
$service = Zend_Gdata_Gbase::AUTH_SERVICE_NAME;
$user = "[email protected]";
$pass = "pa$$w0rd";

// Create an authenticated HTTP client
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);

// Create an instance of the Base service
$service = new Zend_Gdata_Gbase($client);


$newEntry = $service->newItemEntry();

// Add title
$newEntry->title = $service->newTitle('Test Title');

// Add some content
$newEntry->content = $service->newContent('Some Content');
$newEntry->content->type = 'text';

// Define item type
$newEntry->itemType = 'AType';
$newEntry->itemType->type = 'text';

// Add item-specific attributes
$newEntry->addGbaseAttribute("id",'123', "text");
$newEntry->addGbaseAttribute('cuisine', 'some cuisine', 'text');

$dryRun = true;
// Post the item
$createdEntry = $gdata->insertGbaseItem($newEntry, $dryRun);