The main app's Application.cfm was doing strange things in the context of an AMF call, and causing misleading symptoms.
Here's what finally fixed it: I put a new Application.cfm in my (external) cfc directory, and used <cfapplication name="myMainApp'sAppName" />. This way, I'm using the main app's app variables (which are all I need from it), but I'm disinheriting all the garbage that's in the main app's Application.cfm. Thanks very much to both of you, as your help jumpstarted my change of tack! Jamie > Wait, I think I might be on way towards fixing this. I think the > symptoms were misleading me as to the source of the problem. I'll post > back with the resolution if I fix it. > > Jamie > > > Thanks João and Rob. > > > > Unfortunately, I think I already have the things in place that you > > mentioned. Let me recap everything I've got. Please let me know if > you > > see anything wrong, or if you need to see anything else. > > > > The following always times out from Flex, but works every time, > right > > away, from > > http://myapp.localhost/cfc/AddressService.cfc?method=getStates > > > > Here are all the details I can think of: > > > > My virtual host doc root is: > > /var/www/apps/myapp/wwwroot/ > > > > My internal CFCs are here: > > /var/www/apps/myapp/model/ > > > > And my remote CFCs (that serve as remote proxies for my internal > CFCs) > > are here: > > /var/www/apps/myapp/wwwroot/cfc/ > > > > My Flex app is here: > > /var/www/apps/myapp/wwwroot/flex/ > > > > "/myapp" CF Mapping points here: > > /var/www/apps/myapp > > > > Here's the relevant bit from my remoting-config.xml file: > > <access> > > > > > <!-- Use the ColdFusion mappings to find CFCs, by default only CFC > > files under your webroot can be found. --> > > > > > <use-mappings>true</use-mappings> > > > > > <!-- allow "public and remote" or just "remote" methods to be > invoked > > --> > > > > > <method-access-level>remote</method-access-level> > > > > </access> > > > > My Flex RemoteObject is defined like this: > > <!-- I've tried it with both myapp.wwwroot.cfc.AddressService and > cfc. > > AddressService --> > > > <mx:RemoteObject id="addressService" > > source="myapp.wwwroot.cfc.AddressService" > > destination="ColdFusion" > > fault="faultHandler(event)" > > > > > <!-- This service's returned query has the following columns: > > stateID,countryID,state,state_abbr > > notice that it has a specific result handler --> > > <mx:method name="getStates" result="resultHandler(event)"/> > > </mx:RemoteObject> > > > > And the method it calls looks like this: > > <cffunction name="getStates" access="remote" output="false" > > returntype="query"> > > <cfset var local = structNew() /> > > <cfscript> > > local.states = querySim(' > > stateID,countryID,state,state_abbr .... > > > snip ... > > 58|1|Wyoming|WY > > '); > > return local.states; > > </cfscript> > > </cffunction> > > > > > > >Jamie, > > > > > >cfcs don't need to be directly exposed under the webroot, I also > use > > > > >your approach by putting them under some other folder and I also > use > > > > >multiserver version. The only thing you'll need, like others > > mentioned, > > >is to set use mappings = true so the MessageBroker /flex2gateway > > >endpoint use any mappings used by that application. > > > > > >Using Application.cfc you can use <cfset this.mappings['/model'] = > > > >'/var/www/apps/myapp/model/'/> and then your remote project just > have > > to > > >use invoke them using > > >createObject('component','model.pathToYourDesiredCFC'); > > >-- > > > > > >João Fernandes > > > > > >Adobe Community Expert > > >http://www.onflexwithcf.org > > >http://www.riapt.org > > >Portugal Adobe User Group (http://aug.riapt. org) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5618 Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37
