>Assuming these are data objects with defined public properties, everything
>should just work, I think. If they're objects with methods instead of public
>properties, I've seen that work in some cases, but would not want to go so
>far as to say it should "just work".
How would the function definition in the CF look like though?
Let's say we have a component defined in zip.cfc to represent a zip code that
looks like this:
<cfcomponent>
<cfproperty name="City" type="string">
<cfproperty name="State" type="string">
<cfproperty name="Zip" type="string">
<cfproperty name="Latitude" type="numeric">
<cfproperty name="Longitude" type="numeric">
</cfcomponent>
Then we have a different component called zipInfo.cfc that lies in the same
package as zip.cfc. The zipInfo component has a method that returns a zip
object that looks like this:
<cffunction name="getZipInfo" access="remote" returntype="zip">
<cfargument name="zip" type="string" required="true">
....
</cffunction>
Now let's say we want to add a function to the zipInfo component that would
return an array of zip objects. I think the real question that Eric P is
asking is, "How would a function that returns an array of objects be defined?"
This doesn't work:
<cffunction name="zipCodesInCity" access="remote" returntype="zip[]">
<cfargument name="City" type="string" required="true">
<cfargument name="State" type="string" required="true">
...
/cffunction>
You could have the return type be defined as an array or even a query, but in
both cases the fact that the returned data is a list of zip objects gets lost.
Any web service client to this CFC would have no way of knowing the what the
data structure being passed back actually was.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281575
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4