Hello.
I am a newbie doing some testing on the Google code (Java first, PHP
now).
The problem I am having now is the following.
I'm trying to show the calendar list from here:
/***********FORM THAT CALLS ACTION ***************************/
print '<tr><td colspan="5" style="text-align:center">' . "\n" .
'<form method="post" action="' . $_SERVER['PHP_SELF'] .
'" style="margin-top:0;margin-bottom:0">' . "\n" .
'Texto:<input type="text" name="sometext">' . "\n" .
'Enviar a:<input type="text" name="userto">' . "\n" .
'<input type="hidden" name="action" value="prueba_3">' .
"\n" .
'<input type="hidden" name="token" value="' .
$_POST['token']. '">' . "\n";
print '<input type="submit" value="Prueba_2"';
print '></form></td></tr>' . "\n";
/
**************************************************************************/
/*********************prueba_3
handler**********************************/
print '<tr><td colspan="5" style="text-align:center">' . "\n" .
'token:'.$_POST['token'].'<br>'.
'smstext:'.$_POST['sometext'].'<br>'.
'userto:'.$_POST['userto'].'<br>'.
'</tr>' . "\n";
$client = new Zend_Gdata_HttpClient();
$client->setAuthSubToken($_POST['token']);
outputCalendarList($client);
/
**************************************************************************/
/
********************outputCalendarList()********************************/
function outputCalendarList($client)
{
$gdataCal = new Zend_Gdata_Calendar($client);
$calFeed = $gdataCal->getCalendarListFeed(); ////////////LINE 366 OF
CODE
echo "<h1>" . $calFeed->title->text . "</h1>\n";
echo "<ul>\n";
foreach ($calFeed as $calendar) {
echo "\t<li>" . $calendar->title->text . "</li>\n";
}
echo "</ul>\n";
}
/
**************************************************************************/
The log show's this:
/*********************LOG
BEGIN*****************************************************/
Debug Warning: /sms/Zend/Loader.php line 160 - fopen(Zend/Validate/
Hostname/Com.php) [<a href='function.fopen'>function.fopen</a>]:
failed to open stream: No such file or directory
Debug Error: /sms/Zend/Gdata/App.php line 501 - Uncaught exception
'Zend_Gdata_App_HttpException' with message 'Expected response code
200, got 401
<HTML>
<HEAD>
<TITLE>Unknown authorization header</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unknown authorization header</H1>
<H2>Error 401</H2>
</BODY>
</HTML>
' in /var/www/html/sms/Zend/Gdata/App.php:501
Stack trace:
#0 /var/www/html/sms/Zend/Gdata.php(201): Zend_Gdata_App-
>performHttpRequest('GET', 'https://www.goo...', Array, NULL, NULL,
NULL)
#1 /var/www/html/sms/Zend/Gdata/App.php(610): Zend_Gdata-
>performHttpRequest('GET', 'https://www.goo...')
#2 /var/www/html/sms/Zend/Gdata/App.php(541): Zend_Gdata_App-
>get('https://www.goo...')
#3 /var/www/html/sms/Zend/Gdata/App.php(147): Zend_Gdata_App-
>importUrl('https://www.goo...', 'Zend_Gdata_Cale...')
#4 /var/www/html/sms/Zend/Gdata.php(148): Zend_Gdata_App-
>getFeed('https://www.goo...', 'Zend_Gdata_Cale...')
#5 /var/www/html/sms/Zend/Gdata/Calendar.php(129): Zend_Gdata-
>getFeed('https://www.goo...', 'Zend_Gdata_Cale...')
#6 /var/www/html/sms/demo.php(366): Zend_Gdata_Calendar-
>getCalendarListFeed()
#7 /var/www/html/sms/demo.php(864):
outputCalendarList(Object(Zend_Gdata_HttpClient))
#8 /var/www/html/sms/demo.php(895): handlePrueba_3()
#9 {main}
thrown
/************************LOG
END**************************************************/
so somehow line 366 is where it start's breaking.
If I try the outputCalendarList() method at the beginning it goes OK.
After I receive the $token and get the $sessionToken.
When I have the $sessionToken I pass it like a hidden element called
'token' but with the value of $sessionToken.
So I do not know what am I missing..
Thank you very much in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---