Web service invocation?
Hi,
I have two webservices developed and deployed in coldfusion server(development). Webservices.cfc
I am trying to invoke both these webservices one after other from my local server.
Explanation : first service tries to lock a session variable that references other file(within project), and the second service uses that variable to invoke functions from that referenced file as below?
Question:- Do I have to maintain any session variable during invocation(i.e in webservices3.cfm)?
My thinking:- Please correct me if I am wrong
" I am trying to setup a session in first webserice and during the second webservice invocation I am using that variable. So the session variable should be maintained at ther server side(development server)."
suggest me?
Webservices.cfc
<cffunction
name="setUpWebUserSession" access="remote" output="false" returntype="string" displayname="setUpWebUserSession">
<cfargument name="userName" required="true" default=""><cfargument name="applicationToLogIn" required="true" default=""><cfset var isSuccessful = "true"><cflock scope="session" throwontimeout="true" timeout="120" type="exclusive"><cfset session.WebUserUI = createObject("component", "org.atcc.webuser.client.presentation.WebUserUI")>//refenceing other file
<cfset session.WebUserUI.init()><cfset session.isLoggedIn = true></cflock>
<cfreturn isSuccessful></cffunction>
<cffunction
name="getProfileHTML" access="remote" displayname="getProfileHTML" output="false" returntype="string">
<cfset var profileHTML = ""><cfsavecontent variable="profileHTML"><cfoutput>#session.WebUserUI.getWebProfileHTML()#</cfoutput>//Using the session variable and calling function from webuserui</cfsavecontent>
<cfreturn profileHTML>
</cffunction>
Webservices3.cfm(code to invoke two webservices)
<cfset
username="muddu_shafi@yahoo.com">
<cfset
applicationToLogin="atccWeb">
<cfinvoke
webservice="http://localhost/CTiWebServicesAPI/ATCC/WebServicesAPI.cfc?wsdl"
method="setUpWebUserSession"returnvariable="saleshistory"><cfinvokeargument name="username" value="#username#"/><cfinvokeargument name="applicationToLogin" value="#applicationToLogin#"/>
</cfinvoke>
<cfoutput>
#saleshistory#</cfoutput>
<cfinvoke
webservice="http://localhost/CTiWebServicesAPI/ATCC/WebServicesAPI.cfc?wsdl"
method="getProfileHTML"returnvariable="profilehtml">
</cfinvoke>
<cfoutput>
#profilehtml#</cfoutput>
Output:-
true(First webservice executes perfectly)
ErrorCode:
message: session.WebUserUI.getWebProfileHTML() doesn't exist.
detail: Error at line 1, column 8
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:ecom1
'' The error occurred in C:\ColdFusion8\wwwroot\selfprojects\webservices3.cfm: line 21 19 : <cfinvoke webservice="http://10.80.48.15:8080/CTiWebServicesAPI/ATCC/WebServicesAPI.cfc?wsdl"
20 : method="getProfileHTML"
21 : returnvariable="profilehtml">
22 : </cfinvoke>
23 : <cfoutput>#profilehtml#</cfoutput>
