Hi,
I'm not exactly sure what the problem is...
Perhaps it's a problem with GWT, I would like to see the exact code to try
to check it ourselves, if you still need our help.
As for the AppEngine HTTP, for some reason, the header is printed AFTER the
result of gviz_api.
Your output was:
"""
google.visualization.Query.setResponse({'version':'0.5',
'reqId':'0','status':'OK', 'table': {cols:
[{id:'name',label:'Name',type:'string'},
{id:'city',label:'City',type:'string'}],rows: [{c:[{v:'h1'},{v:'c1'}]},
{c:[{v:'h2'},{v:'c2'}]}]}}); Status: 200 OK Content-Type: text/html;
charset=utf-8 Cache-Control: no-cache Content-Length: 0
""" (as you specified).
The "Status: 200 OK ..." part IS the header, it MUST come before the
"google.visualization.Query(...);".
What happens is, when you run it locally, the dev_appengine script lets you
see output even if there's no header (puts in a default header), but when
you use it for real, many services wait for that "Status: 200 OK" header,
and don't get it on time.
That's just a guess, but given the code we might be able to provide more
info.
Regards,
VizBoy.
On Mon, Jan 19, 2009 at 7:44 PM, Craig Schroeder <[email protected]>wrote:
> The python HTTP server automatically generates that part of the header if
> you don't specify it.And it all works the first time, but after that the
> GWT application behaves like the request times out even though I can tell it
> doesn't.
>
> See my other post for more info. (GWT api - query.send only working once)
>
> Thanks,
> Craig
>
>
> On Mon, Jan 19, 2009 at 11:41 AM, VizBoy <[email protected]> wrote:
>
>> Every server that returns a response over HTTP, must first return a
>> header, that includes at least the content-type of the returned data.
>> (Usually something like "Content-type: text/html"), following by 2
>> newlines ("\n\n").
>>
>> Only after that you can write your data (the gviz response for example).
>>
>> The gviz_api library does not write the Content-type header, and you have
>> to print it out yourself.
>>
>> If you'll print the output from gviz_api library after the header, it
>> should work just fine.
>>
>> Regards,
>> VizBoy.
>>
>>
>> On Fri, Jan 16, 2009 at 11:15 AM, todu <[email protected]> wrote:
>>
>>>
>>> I have used the Data Source python library on top of an app engine
>>> local datastore and am able to see the JSON data
>>>
>>> google.visualization.Query.setResponse({'version':'0.5', 'reqId':'0',
>>> 'status':'OK', 'table': {cols: [{id:'name',label:'Name',type:'string'},
>>> {id:'city',label:'City',type:'string'}],rows: [{c:[{v:'h1'},{v:'c1'}]},
>>> {c:[{v:'h2'},{v:'c2'}]}]}}); Status: 200 OK Content-Type: text/html;
>>> charset=utf-8 Cache-Control: no-cache Content-Length: 0
>>>
>>> But when I am using a visualization query I get a timeout?
>>>
>>> var datasource = "http://localhost:8080/table";
>>> var listquery = "select name";
>>> var query = new google.visualization.Query(datasource);
>>> query.setQuery(listquery);
>>> query.send(handleQueryResponse);
>>>
>>> Also have another issue .. I get a table if I use
>>> http://google-visualization.appspot.com/python/dynamic_example as the
>>> source but gives me whole table instead of just the name column.
>>>
>>>
>>> Whats am I doing wrong here any thoughts.
>>>
>>>
>>
>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Visualization 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-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---