That’s right.  If it is in the session, it will be set within the cfc itself.  If you want to pass a parameter to the cfc from flex, you would do it how you originally had it, except you will use a flex variable instead of trying to use the session variable.

 

_____________________________________

Andrew Trice

Cynergy Systems, Inc.

http://www.cynergysystems.com

 

Blog: http://www.cynergysystems.com/blogs/page/andrewtrice

Email: [EMAIL PROTECTED]

Office: 866-CYNERGY 

 


From: [email protected] [mailto:[email protected]] On Behalf Of Bacardi Bryant
Sent: Wednesday, July 12, 2006 11:07 AM
To: [email protected]
Subject: RE: [flexcoders] Passing session variables to webservice

 

Thanks Andy,

 

So if I have a cfc that queries the DB should I code it like so:

 

<cffunction name=”list” access=”remote” returntype=”query”>

 

<cfset EMP_ID = #SESSION.EMP_ID #>

 

<cfquery name=”getRecs” datasource=”#app.dsn#”>

                                                SELECT *

                                                FROM TABLE

                                                WHERE EMP_ID = #EMP_ID #

</cfquery>

 

<cfreturn results>

</cffunction>

 

When I call it from my flex app, I should not set the EMP_ID as an argument for the cfc, but merely call the session variable in the body of the function correct?

I don’t know how I ended up with this project, but I’ve never used flex or flash, so this whole swf/as thing is all kinda weird for now.

Sorry about the spaces, Outlook 2007 seems to have a problem with line breaks and carriage returns.

 

Thanks,

 

Bacardi Bryant

regActionTM Programmer

[EMAIL PROTECTED]

From: [email protected] [mailto:[email protected]] On Behalf Of Andrew Trice
Sent: Tuesday, July 11, 2006 7:18 PM
To: [email protected]; [email protected]
Subject: RE: [flexcoders] Passing session variables to webservice

 

Session variables are maintained in session on the server.  You should be able to get at them directly from within coldfusion.  You do not need to pass them in as arguments.  Remember, session variables are only on the server.  The client runtime can maintain state within itself... the difference is that it uses memory on the client machine.

 

-Andy

 


From: [email protected] on behalf of Bacardi Bryant
Sent: Tue 7/11/2006 4:38 PM
To: [email protected]
Subject: [flexcoders] Passing session variables to webservice

Hi,

 

We have a CF application that uses session variables for security and access control. How do I get at session variables in FLEX. The variables are used in a webservice call.

 

               

<mx:request>

                                                                <var>session.var</var>

                                                </mx:request>

 

This is what I tried, quite naturally that didn’t work. TIA for any help.

 

Thanks,

 

Bacardi Bryant

regActionTM Programmer

[EMAIL PROTECTED]

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to