cfproperty is useful when using custom objects in remote methods. For example, suppose I had the following component:
<cfcomponent displayname="User"> <cfset variables.firstName = "first" /> </cfcomponent>
Which I wanted to use as a return to the remote method consumed through SOAP. I would need <cfproperty> tags for each variable that I wanted to encapsulate in the returned object, so that this object was included in the WSDL document as a complex type. Therefore, the component on top should be:
<cfcomponent displayname="User"> <cfproperty name="firstName" type="string" /> <cfset variables.firstName = "first" /> </cfcomponent>
source share