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=plain will > return text with content-type: text/html > http://myhost.com/rpc/mycfc.cfc?method=run&__BDRETURNFORMAT=wddx will > return text with content-type: text/html > http://myhost.com/rpc/mycfc.cfc?method=run&__BDRETURNFORMAT=json will > return json with content-type: text/html > http://myhost.com/rpc/mycfc.cfc?method=run&__BDRETURNFORMAT=jsonp&callback=myCall > 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 manual http://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 Solution http://www.razuna.com/ Razuna - Open Source Digital Asset Management http://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
