The downside is responses that are simply {} instead of {"response": {}}. I can't see the downside to users, but don't know if the spec allows the first form.
On Tue, Jul 8, 2008 at 5:26 PM, Cassie <[EMAIL PROTECTED]> wrote: > + shindig-dev > (you forgot the list) > > I don't see any problem with ResponseItem<Void>... as long as the tests pass > then it sounds golden to me. > > - Cassie > > > On Tue, Jul 8, 2008 at 5:24 PM, Adam Winer <[EMAIL PROTECTED]> wrote: >> >> Q: about this empty response business. I wanted to use >> ResponseItem<Void> instead of ResponseItem<Object> for createXyz() >> service methods, but that created empty responses which made test code >> unhappy. Any reason not to just do this anyway (and fix the tests, of >> course)? >> >> On Tue, Jul 8, 2008 at 4:15 PM, <[EMAIL PROTECTED]> wrote: >> > Author: doll >> > Date: Tue Jul 8 16:15:17 2008 >> > New Revision: 675046 >> > >> > URL: http://svn.apache.org/viewvc?rev=675046&view=rev >> > Log: >> > Fixed bug in samplecontainer caused by latest abdera changes. >> > >> > The abdera code can now return an empty response so the >> > samplecontainer.html code has been modified to allow that emptiness. >> > >> > >> > Modified: >> > >> > incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html >> > >> > Modified: >> > incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html >> > URL: >> > http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html?rev=675046&r1=675045&r2=675046&view=diff >> > >> > ============================================================================== >> > --- >> > incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html >> > (original) >> > +++ >> > incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html Tue >> > Jul 8 16:15:17 2008 >> > @@ -164,6 +164,9 @@ >> > function dumpStateFile() { >> > sendRequestToServer('dumpstate', 'GET', null, >> > function(data) { >> > + if (!data) { >> > + alert("Could not dump the current state."); >> > + } >> > document.getElementById('gadgetState').innerHTML >> > = gadgets.json.stringify(data); >> > }); >> > @@ -178,15 +181,11 @@ >> > "METHOD" : method, >> > "POST_DATA" : encodeValues(opt_postParams)}; >> > >> > - makeRequest(socialDataPath + url, >> > + makeRequest(socialDataPath + url + "?st=" + gadget.secureToken, >> > function(data) { >> > data = data.data; >> > - if (!data) { >> > - alert("The request to the server caused an error."); >> > - } else { >> > - if (opt_callback) { >> > - opt_callback(data); >> > - } >> > + if (opt_callback) { >> > + opt_callback(data); >> > } >> > }, >> > makeRequestParams); >> > @@ -219,7 +218,7 @@ >> > >> > // We are using eval directly here because the outer response comes >> > from a >> > // trusted source, and json parsing is slow in IE. >> > - var data = eval("(" + txt + ")"); >> > + var data = txt ? eval("(" + txt + ")") : ""; >> > var resp = { >> > data: data >> > }; >> > >> > >> > > >