On 6/19/07, Nathan Wells <[EMAIL PROTECTED]> wrote:
> >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.
>
>

Yeah, I'm curious how this would need to be defined in CF as well.  I
want to know if it's actually possible to have a return type that is
an array of objects AND have that return type accurately defined in
the WSDL's resonse type.

Thanks,
Eric

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281679
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to