Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
PHP Zend Oauth and fusion tables fails on a 404
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pxh  
View profile  
 More options May 26 2010, 12:10 am
From: pxh <piers.hard...@gmail.com>
Date: Tue, 25 May 2010 21:10:31 -0700 (PDT)
Local: Wed, May 26 2010 12:10 am
Subject: PHP Zend Oauth and fusion tables fails on a 404
Hi -
Please excuse breaking this out into a separate post from
http://groups.google.com/group/fusion-tables-users-group/browse_threa...,
but I'm quite stuck with this.  I'm trying to get Oauth working with
the Zend libraries and fusion tables.
   Using the PHP examples at http://code.google.com/apis/gdata/docs/auth/oauth.html,
I have successfully used Oauth for authentication to extract a Google
Docs feed - a complete working example is at http://pastebin.com/g2pVer3q
- you should only need to set your consumer key/secret to get this to
work.
  I've modified the Google Docs example to do a basic "show tables" -
the modified example is at http://pastebin.com/afHs0DYP .  This is
identical to the Google Docs example above, except for the setting of
the scope, and the gdata call:

scope = 'http://tables.googlelabs.com/api/query'

require_once 'Zend/Gdata/Gbase.php';
require_once 'Zend/Gdata/Query.php';
$httpClient = $accessToken->getHttpClient($oauthOptions);
$gdata = new Zend_Gdata_Gbase($httpClient, 'fusiontables');
$url = "http://tables.googlelabs.com/api/query?sql=show%20tables";
$data = $gdata->get($url);

The bit that really gets me about this, is that the authentication
appears to happen correctly - just the same as for the Google Docs
example - but the actual Gdata call returns a 404.  What I find even
more puzzling is that if I swap the authentication mechanism for
ClientLogin, then the call works.

Error as follows:
( ! ) Zend_Gdata_App_HttpException: Expected response code 200, got
404
Not Found
Error 404
in /home/piers/code/Zend/Gdata/App.php on line 700

Any help with this will be gratefully received.

Thanks,
Piers Harding.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jude mwenda  
View profile  
 More options May 26 2010, 3:01 pm
From: jude mwenda <judemwe...@gmail.com>
Date: Wed, 26 May 2010 22:01:52 +0300
Local: Wed, May 26 2010 3:01 pm
Subject: Re: PHP Zend Oauth and fusion tables fails on a 404

Hi,
Please note that you need to catch the exceptions for it to work. IMHO i
think it would be
                      try
                     {
                        $httpClient =
$accessToken->getHttpClient($oauthOptions);
                        $gdata = new Zend_Gdata_Gbase($httpClient,
'fusiontables');
                      }catch Exception e
                       {
                           echo(e);
                          }
ps i also noticed that you have @accessToken is it initiated? or how is it
declared?

On 26 May 2010 07:10, pxh <piers.hard...@gmail.com> wrote:

--
Regards,

Jude Mwenda
Skype id: jmwenda
Twitter: www.twitter.com/judemwenda
Web: www.africangeogeek.com

"Was ist mein Leben, wenn ich nicht mehr nützlich für andere."
Johann Wolfgang von Goethe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Piers Harding  
View profile  
 More options May 26 2010, 7:26 pm
From: Piers Harding <piers.hard...@gmail.com>
Date: Thu, 27 May 2010 11:26:47 +1200
Local: Wed, May 26 2010 7:26 pm
Subject: Re: PHP Zend Oauth and fusion tables fails on a 404

Hi Jude -

thanks for taking a look.

$accessToken is set OK, and $gdata gets allocated.  The problem happens on
the actual call at:
$url = "http://tables.googlelabs.com/api/query?sql=show%20tables";
$data = $gdata->get($url);

I've traced the call with wireshark, and it looks as if everything is there:
GET /api/query?sql=SHOW+TABLES HTTP/1.1
Host: tables.googlelabs.com
Connection: close
User-Agent: MyCompany-MyApp-1.0 Zend_Framework_Gdata/1.10.4
Accept-encoding: identity
Authorization: OAuth
realm="",oauth_consumer_key="my-consumer-key",oauth_nonce="xxxxxxxxxxxxx",o auth_signature_method="HMAC-SHA1",oauth_timestamp="xxxxxxxxxxxx",oauth_vers ion="1.0",oauth_token="xxxxxxxxxxxxx",oauth_signature="xxxxxxxxxxxxxxxxxxxx xxx"

I know that the Java implementation example at
http://code.google.com/p/fusion-tables-api/ works, but I can't figure out
what would be different between the two Oauth implementations.

Cheers,
Piers Harding.

On 27 May 2010 07:01, jude mwenda <judemwe...@gmail.com> wrote:

--
Home - http://www.piersharding.com
mailto:pi...@ompka.net

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josh Livni  
View profile  
 More options Jun 8 2010, 6:48 pm
From: Josh Livni <jli...@google.com>
Date: Tue, 8 Jun 2010 15:48:28 -0700
Local: Tues, Jun 8 2010 6:48 pm
Subject: Re: PHP Zend Oauth and fusion tables fails on a 404

Hi Piers,

Can you try encoding the url as ?sql=show+tables instead of show%20tables?

If that does not work, can you try the oauth_signature_method of RSA-SHA1,
or alternatively confirm your HMAC-SHA1 consumer key and timestamp settings
are both tested at somewhere like
http://googlecodesamples.com/oauth_playground/ ?

Cheers,

  -Josh

On Wed, May 26, 2010 at 4:26 PM, Piers Harding <piers.hard...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Piers Harding  
View profile  
 More options Jun 8 2010, 7:35 pm
From: Piers Harding <piers.hard...@gmail.com>
Date: Wed, 9 Jun 2010 11:35:57 +1200
Local: Tues, Jun 8 2010 7:35 pm
Subject: Re: PHP Zend Oauth and fusion tables fails on a 404

Hi -

I've the '+' instead of '%20' for space, with exactly the same error.

I know that my key and secret work, as I can get the Java sample
implementation to work, and I've hacked the python gdata libraries to work
too.  I've also taken the PHP oauth consumer libraries out of simplesamlphp,
and can get them to work too, so at the moment it's pointing to be a Zend
specific problem.

Thanks for having a look,
Piers Harding.

On 9 June 2010 10:48, Josh Livni <jli...@google.com> wrote:

--
Home - http://www.piersharding.com
mailto:pi...@ompka.net

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jose A Reyero  
View profile  
 More options Jul 1 2010, 11:49 am
From: Jose A Reyero <freela...@gmail.com>
Date: Thu, 1 Jul 2010 08:49:28 -0700 (PDT)
Local: Thurs, Jul 1 2010 11:49 am
Subject: Re: PHP Zend Oauth and fusion tables fails on a 404
I'm getting the same outcome (which is normal as I'm trying with
similar code).

Also, when I try a 'POST' Instead of a 'GET', I get:

Unable to execute query due to an internal error. Please report the
error to googletables-feedb...@google.com.
Error 500

My code looks like:

$response = $gdata->post("sql=show tables", 'http://
tables.googlelabs.com/api/query');

(Also tried with "show%20tables" and other variations, got the same);

On Jun 9, 1:35 am, Piers Harding <piers.hard...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Piers Harding  
View profile  
 More options Jul 1 2010, 3:38 pm
From: Piers Harding <pi...@ompka.net>
Date: Fri, 2 Jul 2010 07:38:13 +1200
Local: Thurs, Jul 1 2010 3:38 pm
Subject: Re: PHP Zend Oauth and fusion tables fails on a 404

Hi -

It's something to do with the Zend libs.  I haven't had the time to hunt
down exactly what is wrong, but I happened to find another set of libraries
in connection with the simplesamlphp implementation
http://code.google.com/p/simplesamlphp/source/browse/trunk/modules/oa...
I've used this as a basis for the implementation that I'm doing until
I
hear back from the Zend project (I logged a bug with them).

Cheers,
Piers Harding.

On 2 July 2010 03:49, Jose A Reyero <freela...@gmail.com> wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »