sorry, that was just me mis-typing my example.  I assure you that both versions were 
indeed returning a structure.  The only difference should have been the fact that one 
has the query in-line in the method, and the other uses a 2nd method to return the 
query, which is then later added to my tReturnData struct.

Best,
Nolan


-----Original Message-----
From: Joe Rinehart [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 19, 2004 11:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] bug in web services? intentional rule from MM?


Nolan,

On a quick visual parse your first method is missing a return statement:

<cfreturn tReturnData />

-joe

On Thu, 19 Aug 2004 11:33:25 -0700, Nolan Erck <[EMAIL PROTECTED]> wrote:
> 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]
> 


-- 
For Tabs, Trees, and more, use the jComponents:
http://clearsoftware.net/clear/?template=downloads.jComponents
----------------------------------------------------------
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]
----------------------------------------------------------
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