On 11/21/05, Snake <[EMAIL PROTECTED]> wrote:
> Does anyone know what the undocumented functionality of cfproperty is,
> someone mentioned it to me the other day, but it has escaped me.
What undocumented functionality?
<cfproperty> serves just two purposes:
1. If you write a web service that returns a complex type, you can use
a CFC that 'declares' the public keys of that type using <cfproperty>.
2. <cfproperty> adds property metadata to the CFC metadata (this is
really just a side-effect - the metadata is intended to support #1).
An example of #1 is returning a structure containing a name and an age:
person.cfc:
<cfcomponent>
<cfproperty name="name" type="string"/>
<cfproperty name="age" type="numeric"/>
</cfcomponent>
Then your web service method (in another CFC):
<cffunction name="getPerson" returntype="person" access="remote" output="false">
...
<cfset var result = createObject("component", "person") />
...
<cfset result.name = "Sean" />
<cfset result.age = 43 />
...
<cfreturn result />
</cffunction>
The metadata enables CF to generate the appropriate WSDL so that other
servers can unmarshall the structured return type object.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224888
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54