Web services work the same way as flash remoting in terms of setting up your facades.
Okay, how do I do it?
I have been unable to set session variables in 1 Web Service call and access them in a second.
I suppose you could call what I described an 'application facade', though I'd call it a 'web serivces facade'.
I had said "application" facade, because you said you'd use the application scope to store the "business Logic CFC", which would mean no individual session data.
The facade is to allow access to your application via web services or flash remoting, it has nothing to do with how the operation is implemented.
I want to know how to implement it.
If you've got a really complex app with a lot of different business operations that need to be exposed, then breaking them down into multiple facades makes sense, but in general, i'd just keep them all in one place.
The original plan was 1 "Web Service" CFC, with only a handful of functions. We weren't building a GUI front end, just the Web Service access so that some of my client's clients could perform some functions on our backend. My original post about "Maintaining sessions between web service calls" is below:
I posted this on cfcdev a while back and heard nothing, so I thought I'd try here.
Is there a way to maintain state between web service requests? I've done some searching for answers, but haven't found anything related to this.
Obviously since I'm posting here, I'm building the web services in CF. J2EE sessions are enabled, so I figured I could just return the JSessionID from an initial request, and have the user pass it on to all future requests as an argument. Then in the method I could do something along the lines of:
<cfset session.jsessionID = arguments.jsessionID>
And hijack the previous session. It's apparently not that easy. This is what I've discovered:
If I return the text from the session scope I get the URLToken and a SessionID variable (Not JsessionID).
The URL token contains the CFID, CFTOKEN, and JSessionID values in it. I had thought CFID and CFToken were not supposed to be set if J2EE sessions were enabled.
The cookie scope contains the CFID and CFToken value. No JSessionID.
Here is the code I'm using to return session / cookie scopes:
WebService.cfc <cfcomponent output="no">
<Cffunction name="GetScopes" access="remote" output="false" returntype="string">
<cfset var result = "">
<cfloop collection="#session#" item="Test">
<cfif IsStruct(StructFind(session, test))>
<cfset Result = Result & test & "Structure<Br>">
<cfelseif IsArray(StructFind(session, test))>
<cfset Result = Result & test & "Array<Br>">
<cfelse>
<cfset Result = Result & test & StructFind(session, test) & "<BR>">
</cfif>
</cfloop>
<cfset Result = Result & "<Br><Br>">
<cfloop collection="#cookie#" item="Test">
<cfif IsStruct(StructFind(cookie, test))>
<cfset Result = Result & test & "Structure<Br>">
<cfelseif IsArray(StructFind(cookie, test))>
<cfset Result = Result & test & "Array<Br>">
<cfelse>
<cfset Result = Result & test & StructFind(cookie, test) & "<BR>">
</cfif>
</cfloop>
<Cfreturn Result>
</cffunction> </cfcomponent>
The Application.cfm does a lot of stuff, but here is the cfapplication tag:
<cfapplication
name="vanilladmin"
clientmanagement="no"
sessionmanagement="yes"
setclientcookies="yes"
setdomaincookies="no">Does anyone have any thoughts they wish to share or resources they wish to point me at?
--
Jeffry Houser, Web Developer, Writer, Songwriter, Recording Engineer
AIM: Reboog711 | Phone: 1-203-379-0773
--
My Books: <http://www.instantcoldfusion.com>
My Recording Studio: <http://www.fcfstudios.com>
My Energetic Acoustic Rock Band: <http://www.farcryfly.com>
--
When did Reality Become TV
----------------------------------------------------------
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]
