muddu_shafi
05-04-2009, 06:24 PM
Hi,
I am having trouble maintaing session information between webservice calls. I have two webserives running from a single file?
First webservice creates a session setting few session variable.
Second webservice (on the server side) uses the session variables(first set) to call other function?
My application.cfm file
<CFAPPLICATION
NAME="Sha"
CLIENTMANAGEMENT="yes"
SESSIONMANAGEMENT="Yes"
SETCLIENTCOOKIES="yes"
SESSIONTIMEOUT="#createTimeSpan(0,1,0,0)#"
APPLICATIONTIMEOUT="#createTimeSpan(1,0,0,0)#"
clientStorage = "cookie">
My file on the server:
<cffunction name="setUpSession" access="remote" output="false" turntype="string" displayname="setUpWebUserSession">
<cfargument name="userName" required="true" default="">
<cfargument name="applicationToLogIn" required="true" default="">
<cflock scope="session" throwontimeout="true" timeout="120" type="exclusive">
<cfset session.WebUserUI = createObject("component", "org.atcc.webuser.client.presentation.WebUserUI")>
<cfset session.WebUserUI.init()>
</cflock>
<cfreturn true>
</cffunction>
<cffunction name="getProfileHTML" access="remote" displayname="getProfileHTML" output="false" returntype="string">
<cfset var profileHTML = "">
<cfsavecontent variable="profileHTML">
<cfoutput>#session.WebUserUI.getWebProfileHTML()#</cfoutput>
</cfsavecontent>
<cfreturn profileHTML>
</cffunction>
My Webservice invoation function:-
<cfinvoke webservice="http://localhost:8080/CTiWebServicesAPI/ATCC/WebServicesAPI.cfc?wsdl"
method="setUpSession"
returnVariable="soo">
<cfinvokeargument name="userName" value="sha@gmail.com">
<cfinvokeargument name="applicationToLogIn" value="sha">
</cfinvoke>
<cfoutput> #soo# </cfoutput>
<cfinvoke webservice="http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
method="getWebProfileHTML"
returnvariable="profilehtml">
<cfinvokeargument name="passedStruct" value="#passedStruct#"/>
</cfinvoke>
<cfoutput>#profilehtml#</cfoutput>
O/p
true
Could not find session.WebUserUI or session.webUserUI not defined.
Can anyone explain me why is the application not holding session variables between calls?
What should I do?
Please Help me?
I am having trouble maintaing session information between webservice calls. I have two webserives running from a single file?
First webservice creates a session setting few session variable.
Second webservice (on the server side) uses the session variables(first set) to call other function?
My application.cfm file
<CFAPPLICATION
NAME="Sha"
CLIENTMANAGEMENT="yes"
SESSIONMANAGEMENT="Yes"
SETCLIENTCOOKIES="yes"
SESSIONTIMEOUT="#createTimeSpan(0,1,0,0)#"
APPLICATIONTIMEOUT="#createTimeSpan(1,0,0,0)#"
clientStorage = "cookie">
My file on the server:
<cffunction name="setUpSession" access="remote" output="false" turntype="string" displayname="setUpWebUserSession">
<cfargument name="userName" required="true" default="">
<cfargument name="applicationToLogIn" required="true" default="">
<cflock scope="session" throwontimeout="true" timeout="120" type="exclusive">
<cfset session.WebUserUI = createObject("component", "org.atcc.webuser.client.presentation.WebUserUI")>
<cfset session.WebUserUI.init()>
</cflock>
<cfreturn true>
</cffunction>
<cffunction name="getProfileHTML" access="remote" displayname="getProfileHTML" output="false" returntype="string">
<cfset var profileHTML = "">
<cfsavecontent variable="profileHTML">
<cfoutput>#session.WebUserUI.getWebProfileHTML()#</cfoutput>
</cfsavecontent>
<cfreturn profileHTML>
</cffunction>
My Webservice invoation function:-
<cfinvoke webservice="http://localhost:8080/CTiWebServicesAPI/ATCC/WebServicesAPI.cfc?wsdl"
method="setUpSession"
returnVariable="soo">
<cfinvokeargument name="userName" value="sha@gmail.com">
<cfinvokeargument name="applicationToLogIn" value="sha">
</cfinvoke>
<cfoutput> #soo# </cfoutput>
<cfinvoke webservice="http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
method="getWebProfileHTML"
returnvariable="profilehtml">
<cfinvokeargument name="passedStruct" value="#passedStruct#"/>
</cfinvoke>
<cfoutput>#profilehtml#</cfoutput>
O/p
true
Could not find session.WebUserUI or session.webUserUI not defined.
Can anyone explain me why is the application not holding session variables between calls?
What should I do?
Please Help me?