Hi Nitai, thanks for the response. See my post again. My complain is just because the http content type is not what it should be. Of course json is returning the result of serializeJSON but the http content type is text/html isntead of application/json, and the same for the other types.
Also declaring jsonp as returnformat is breaking the service. The worst thing also is that FORM is empty. On 31 mar, 18:29, "Nitai @ Razuna" <[email protected]> wrote: > David, > > There are a couple of things you need to take care of. > > 1. Make sure that your function has the access="remote" set. > 2. Make sure that your returntype="struct" and that your function > returns a struct. > 3. Set a returnformat="json". > > Now given the above your REST call will return a JSON data structure. > > If you want to return JSONP you need to append > &__BDRETURNFORMAT=jsonp&callback=? to your REST call. > > We've just done nothing else in the last week(s) and worked on web > services, that's why I'm certain that all calls work as expected. But > of course, you can not use "PLAIN" for a structure or return "plain" > (string) for a JSON structure. (not saying that you do, just trying to > help) :-) > > Kind Regards, > Nitai > > On Sat, Mar 31, 2012 at 4:53 PM, David G Ortega > > > > > > > > > > <[email protected]> wrote: > > Hi guys, > > > I have done a restful service with openDB but It seem to me that the > > response type of the service is incorrect. According to the example in > > the docs > > > <cfcomponent> > > <!--- assume this is saved @ /rpc/mycfc.cfc ---> > > > <cffunction name="run" access="remote" returntype="string"> > > <cfreturn "from a remote"> > > </cffunction> > > > </cfcomponent> > > >http://myhost.com/rpc/mycfc.cfc?method=run&__BDRETURNFORMAT=plainwill > > return text with content-type: text/html > >http://myhost.com/rpc/mycfc.cfc?method=run&__BDRETURNFORMAT=wddxwill > > return text with content-type: text/html > >http://myhost.com/rpc/mycfc.cfc?method=run&__BDRETURNFORMAT=jsonwill > > return json with content-type: text/html > >http://myhost.com/rpc/mycfc.cfc?method=run&__BDRETURNFORMAT=jsonp&cal... > > will return jsonp with content-type: text/html > > > I think that the content types should be changed into text/xml, > > application/json and application/javascript to be much more compilant > > > I also found a bug. If you specify returntype='jsonp' by default the > > call breaks. > > > OpenBD Bad File Exception > > Need some help? Visit our manualhttp://openbd.org/manual/ > > The page you were executing caused an internal server error > > Type Template > > Message Invalid Attribute > > Tag CFFUNCTION > > Position Line=96; Column=82 > > Detail Illegal Attribute Value: The RETURNFORMAT attribute can only > > have one of the following values: JSON, WDDX, PLAIN > > > -- > > online documentation:http://openbd.org/manual/ > > google+ hints/tips:https://plus.google.com/115990347459711259462 > > http://groups.google.com/group/openbd?hl=en > > -- > See for yourself how easy it is to manage files today. Join the revolution! > > Razuna - Hosted Digital Asset Management Solutionhttp://www.razuna.com/ > > Razuna - Open Source Digital Asset Managementhttp://www.razuna.org/ > > Twitter -http://twitter.com/razunahq > Facebook -http://www.facebook.com/razunahq > Support Platform -http://getsatisfaction.com/razuna -- online documentation: http://openbd.org/manual/ google+ hints/tips: https://plus.google.com/115990347459711259462 http://groups.google.com/group/openbd?hl=en
