On Tue, Mar 24, 2009 at 9:31 AM, Damon Gentry <[email protected]>wrote:
>
> Hi all,
>
> I have a bit of a software architecture question for the group. We're
> building a new web application that will have 2 different presentation
> tiers delivered on two different server farms. We have CF8 on both
> server farms, but Transfer is only installed on one of them. We'll
> use Transfer and Flex to build the back-end administration application
> on server farm A, and we'll use ColdFusion to build the client
> presentation application (read-only) on server farm B.
>
> We are planning to create a set of facade CFCs on server farm A that
> would utilize Transfer to retrieve data (well, objects and methods to
> get the data) from the database. Server farm B would consume these
> web services from server farm A.
>
> What I'd like to know is this: Can you create a facade CFC that
> returns a TransferObject as part of a web service? Like this:
>
> <cffunction name="getPerson" access="remote"
> returntype="com.transfer.TransferObject"...>
> <cfargument name="personID" type="string" required="true" />
> <cfreturn application.transfer.get('person.Person',
> arguments.personID) />
> </cffunction>
> The calling method (from server farm B) would then have access to the
> object (and its methods) and use those methods to render data about
> the object. Like this:
>
> <cfset ws = createObject('webservice', 'http://serverFarmA/app/
> person.cfc?wsdl <http://serverFarmA/app/%0Aperson.cfc?wsdl>') />
> <cfset myPerson = ws.getPerson(someID) />
> <cfoutput>#myPerson.getfirst_name()#</cfoutput>
>
> We've tried this approach, and we are running into deserialization
> issues when trying to use a method on the returned object. (We can
> dump the variable created with createObject() and see its methods.)
> Is there a workaround available for this issue? Or should we simply
> return simple data (structs, arrays, queries, etc...) from our facade
> CFCs and not attempt to return objects?
Remember that a web service returns a complex data type, not an object. It's
really nothing but a collection of properties with their types defined. I'm
not even sure if the getter methods will work unless the values are in the
THIS scope, since there's no way the calling code can "know" where your
property actually is or what it is called. Does getFirstName return
variables.firstName? or variables.instance.firstName? or
variables.myData.firstName? The web service result will have no way to
handle this since there is no "code" any more in your methods.
I'd recommend looking at something like ColdSpring's AOP capabilities to
expose your service through a remote proxy, and apply some translation
advice(s) to the methods that will convert your CFCs into simple DTO objects
(a CFC with nothing but cfproperty tags and and corresponding values in the
THIS scope).
>
>
> Thanks in advance for any help on this. All of my google searches for
> this result in java gurus discussing details of AXIS that are way over
> my head! I would appreciate a CF-centric response to this (if
> possible).
> >
>
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
You received this message because you are subscribed to the Google Groups
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---