So we just went round and round with some code in a web service that looks like so:

<cffunction method="getUserData" returnType="struct" access="remote">
        <cfset var tReturnData = StructNew() />
        <cfset var qLoginInfo = "" />

        <cfquery name="qLoginInfo" datasource="...">
                valid query returning 1 record
        </cfquery>

        <cfif qLoginInfo.recordCount>
                <cfset tReturnData.success = true />
                <cfset tReturnData.loginInfo = qLoginInfo />
        </cfif>
</cffunction>

The line that was causing an error about deserialization was:
<cfset tReturnData.loginInfo = qLoginInfo />

We tried playing with Duplicate(), StructCopy(), etc, but ot no avail.

However, if I wrap the query in it's own method, that returns a query, it works just 
fine. Like so:

<cffunction method="getUserData" returnType="struct" access="remote">
        <cfset var tReturnData = StructNew() />
        <cfset var qLoginInfo = "" />

        <cfset qLoginInfo = getLoginInfoFromDatabase()>

        <cfif qLoginInfo.recordCount>
                <cfset tReturnData.success = true />
                <cfset tReturnData.loginInfo = qLoginInfo />
        </cfif>
</cffunction>

getLoginInfoFromDatabase has a returnType of "query" which is exactly what it was 
before.  However *something* is getting generated differently because one works and 
one throws an error about deserialization of the data.

Is this intentional by Macromedia to make developers separate business logic from 
their data layer?  A bug? Something else that I'm not noticing because it's early and 
I'm uncaffeinated?

Thanks,
Nolan

----------------------------------------------------------
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]

Reply via email to