On Tue, 26 Oct 2004 16:51:32 +0200 (CEST), Stijn Dreezen
<[EMAIL PROTECTED]> wrote:
> I use to write a facade to access my web services from javascript.

Just to be clear, if you call a CFC as a Web Service, you get back a
SOAP XML packet exactly as you would expect.

And, as Nathan has pointed out (more than once in this thread!), if
you want browser-compatible output then CF has a very consistent way
to support that - write to the output buffer!

Consider this idiom, if you're really hooked on calling CFCs directly:

<!--- for use as a local call or a web service or a flash remoting call --->
<cffunction name="getData" returntype="string" access="remote" output="no">
... do whatever ...
<cfreturn someString />
</cffunction>

<!--- for use where HTML needs to be generated to the output buffer --->
<cffunction name="displayData" returntype="void" access="public" output="yes">
<cfoutput>#getData()#</cfoutput>
</cffunction>

Note that even the naming convention tells you something important
here: displayData() will display something and getData() will just
*get* data, not display it.
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Got Gmail? -- I have 1 invite

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to