Hi Nitish, It looks like the default setting for returnformat is wddx. If I leave the argument blank in the function declaration, and also don't include the BDRETURNFORMAT=wddx, I get results back in wddx.
I can't set returnFormat to XML, as it errors out and says invalid. I'm thinking I will just leave returnFormat blank (since then it defaults to WDDX and I don't have to declare it if I want WDDX) and if the API user wants it differently, they can just add the BDRETURNFORMAT argument. Sound reasonable? -Jason On Sat, Aug 4, 2012 at 7:46 AM, nitish pandey <[email protected]> wrote: > Even this works: > http://details.at/config/cfc/functions.cfc?method=checkEmailValid&[email protected]&__BDreturnformat=json > > I can only infer that struct returnformat cannot be converted to a plain > string and that just needs to be true if you put return format as plain. > > Since it is designed for remote calls ( i believe some Ajax call) just put > it as json and move on. > if it is not a remote call and you want to handle structures internally then > you should not be putting the access as remote. > And if you wish to call it both internally and from remote, XML would be the > wisest choice. > > > > -nitish > > 2012/8/4 Jason King <[email protected]> >> >> anybody..... >> >> >> >> On Mon, Jul 30, 2012 at 10:33 AM, Jason King <[email protected]> >> wrote: >> > Hi Alan, >> > >> > I have a smaller, simpler example that has the same problem. >> > Hopefully this is enough and I'm ok with posting it up here in case >> > anybody else wants to chime in. >> > >> > As a test, I've created a cfc called 'functions' and within it a >> > function that checks an email address for some basic components. >> > 'checkEmailValid' >> > >> > If I don't include the '&__BDRETURNFORMAT=wddx' argument in the url, I >> > get an error. Otherwise, you'll get the XML back. >> > >> > Here's a URL you can hit to check >> > >> > http://details.at/config/cfc/functions.cfc?method=checkEmailValid&[email protected] >> > >> > Here's the code. >> > >> > <!--- application.cfc ---> >> > <cfset Application.functions = CreateObject("component", >> > "config.cfc.functions") /> >> > >> > >> > <!--- functions.cfc ---> >> > >> > <cfcomponent displayname="functions" hint="details.at component for >> > general functions"> >> > >> > <cffunction name="checkEmailValid" returntype="struct" >> > output="no" >> > access="remote" returnformat="plain"> >> > >> > <cfargument name="email" type="string" required="true" >> > default="" >> > hint="user email" /> >> > >> > <cfset checkEmailValidResults=StructNew()> >> > <cfset checkEmailValidResults.error = 0> >> > >> > <cfset var local = StructNew()> >> > <cfset local.email = "#arguments.email#"> >> > >> > <cfif (find('@',local.email) eq 0) OR >> > (find('.',local.email) eq 0) >> > OR (local.email eq "")> >> > <cfset checkEmailValidResults.error = 1> >> > </cfif> >> > >> > <cfreturn checkEmailValidResults> >> > >> > </cffunction> >> > >> > </cfcomponent> >> >> -- >> online documentation: http://openbd.org/manual/ >> http://groups.google.com/group/openbd?hl=en > > > > > -- > -Nitish > "Faith is a free Option" > http://www.forcesofindia.com/profiles/np > > -- > online documentation: http://openbd.org/manual/ > http://groups.google.com/group/openbd?hl=en -- online documentation: http://openbd.org/manual/ http://groups.google.com/group/openbd?hl=en
