Answered
I am getting a horrible error: 'Unable to invoke CFC
I am getting a horrible error when I try and call a cfc.
faultCode:Server.Processing faultString:'Unable to invoke CFC - Context validation error for the cffunction tag.' faultDetail:'The start tag must have a matching end tag. An explicit end tag can be provided by adding </cffunction>. If the body of the tag is empty, you can use the shortcut <cffunction .../>.<p>The CFML compiler was processing:<ul><li>The body of a cfquery tag beginning on line 157, column 18.</ul>'
the cfc function in question is as follows:
<cffunction name="editUser" access="remote" returntype="boolean">
<cfargument name="firstName" required="true" type="string">
<cfargument name="surname" required="true" type="string">
<cfargument name="userName" required="true" type="string">
<cfargument name="password" required="true" type="string">
<cfargument name="staffID" required="true" type="numeric">
<cfargument name="area" required="true" type="string">
<cfargument name="position" required="true" type="string">
<cfquery name="q" datasource="#datasource#"> //(line 157)
update staff_charts_staff set
firstName = <cfqueryparam value="#arguments.firstname#" cfsqltype="cf_sql_varchar">,
surname = <cfqueryparam value="#arguments.surname#" cfsqltype="cf_sql_varchar">,
username = <cfargument name="#arguments.userName" required="true" type="string">,
password = <cfargument name="#arguments.password" required="true" type="string">,
staffID = <cfqueryparam value="#arguments.staffID#" cfsqltype="cf_sql_varchar">,
area = <cfqueryparam value="#arguments.area#" cfsqltype="cf_sql_varchar">,
position = <cfqueryparam value="#arguments.position#" cfsqltype="cf_sql_varchar">
</cfquery>
<cfset flash.result=true>
<cfreturn flash.result>
</cffunction>
Any ideas? Could it be a character encoding issue?
faultCode:Server.Processing faultString:'Unable to invoke CFC - Context validation error for the cffunction tag.' faultDetail:'The start tag must have a matching end tag. An explicit end tag can be provided by adding </cffunction>. If the body of the tag is empty, you can use the shortcut <cffunction .../>.<p>The CFML compiler was processing:<ul><li>The body of a cfquery tag beginning on line 157, column 18.</ul>'
the cfc function in question is as follows:
<cffunction name="editUser" access="remote" returntype="boolean">
<cfargument name="firstName" required="true" type="string">
<cfargument name="surname" required="true" type="string">
<cfargument name="userName" required="true" type="string">
<cfargument name="password" required="true" type="string">
<cfargument name="staffID" required="true" type="numeric">
<cfargument name="area" required="true" type="string">
<cfargument name="position" required="true" type="string">
<cfquery name="q" datasource="#datasource#"> //(line 157)
update staff_charts_staff set
firstName = <cfqueryparam value="#arguments.firstname#" cfsqltype="cf_sql_varchar">,
surname = <cfqueryparam value="#arguments.surname#" cfsqltype="cf_sql_varchar">,
username = <cfargument name="#arguments.userName" required="true" type="string">,
password = <cfargument name="#arguments.password" required="true" type="string">,
staffID = <cfqueryparam value="#arguments.staffID#" cfsqltype="cf_sql_varchar">,
area = <cfqueryparam value="#arguments.area#" cfsqltype="cf_sql_varchar">,
position = <cfqueryparam value="#arguments.position#" cfsqltype="cf_sql_varchar">
</cfquery>
<cfset flash.result=true>
<cfreturn flash.result>
</cffunction>
Any ideas? Could it be a character encoding issue?
