It's your services-config.xml that is off. Try using this: <?xml version="1.0" encoding="UTF-8"?> <services-config> <services> <service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage"> <destination id="amfphp"> <channels> <channel ref="my-amfphp"/> </channels> <properties> <source>*</source> </properties> </destination> </service> </services>
<channels> <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel"> <endpoint uri="http://localhost/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition> </channels> </services-config> Set destination to 'amfphp' and 'endpoint' to your ColdFusion endpoint in the RemoteObject tag. Then you can change the 'amfphp' names to 'coldFusion' if it bothers you ;) Patrick Jim Pickering a écrit : > > [RPC Fault faultString= "[MessagingError message='Unknown > destination' Coldfusion' .']" faultCode="InvokeFa iled" > faultDetail= "Couldn'testabli sh a connection to 'Coldfusion' "] > > Everything is default. CFMX 7.0.2 Multiserver on IIS DevNet Edition for > Development on one machine. FlexBuilder2 on my workstation machine. A > drive mapping to the webroot and to the JRun4 folder. My Flex Project is > configured and successfully validated to the root folder at > J:\servers\cfusion\ cfusion-ear\ cfusion-war. > > Compiler in FlexBuilder 2 is comfigured with this: -services > "J:\servers\ cfusion\cfusion- ear\cfusion- war\WEB-INF\ flex\services- > config\ > .xml" -locale en_US > > This is as basic as it gets - I am trying to get a HelloWorld app (from > lynda.com actually) working with Flex 2 and CF via Remoting on a > remoteCF Development Server. Can this work or is there a bug with Flex > 2which requires that CF be loaded locally for development? > > If anyone is successfully developing Flex 2 apps with a remote > Coldfusion server, I would appreciate it if you could walk me through > the setup steps. Below are more details of what I've done so far. > > ------------ --------- --------- ------- > > I have taken the time to read past entries on this topic, but the issues > were slightly different than mine and didn't offer enough of a solution > to help resolve my issue. > > In my HelloFromColdfusion .mxml file is the following code: > > <?xml version="1.0" encoding="utf- 8"?> > <mx:Application xmlns:mx="http://www.adobe. com/2006/ mxml > <http://www.adobe.com/2006/mxml>" > layout="vertical" > > > <mx:RemoteObject id="cfService" > destination= "Coldfusion" > source="flex2btb. cfc.MyService" /> > > <mx:Button label="Call Coldfusion" click="cfService. helloWorld( )"/> > > <mx:Label text="{cfService. helloWorld. lastResult} " fontSize="18" /> > </mx:Application> > > In a subdirectory in the webroot called flex2btb, in the flex directory > is MyService.cfc. I have the crossdomain. xml file in my webroot also. > The code is very basic: > > <cfcomponent extends="Service" > > > <cffunction name="helloWorld" access="remote" returntype=" string"> > <cfreturn "Hello World from Coldfusion"> > </cffunction> > </cfcomponent> > > BTW, I get the blank white screen when I browse to > http://www.[mydomainhere] .com/flex2gatewa y. > > I get this error when I run the app at > http://www.[mydomainhere] .com/flex2btb/ flex/HelloFromCo ldFusion. html: > > [RPC Fault faultString= "[MessagingError message='Unknown destination > 'Coldfusion' .']" faultCode="InvokeFa iled" faultDetail= "Couldn't > establish a connection to 'Coldfusion' "] > at > mx.rpc::AbstractInv oker/http://www.adobe. com/2006/ flex/mx/internal > ::invo\ > ke <http://www.adobe.com/2006/flex/mx/internal::invoke>() > at > mx.rpc.remoting. mxml::Operation/http://www.adobe. com/2006/ > flex/mx/intern\ > al::invoke <http://www.adobe.com/2006/flex/mx/internal::invoke>() > at mx.rpc.remoting: :Operation/ send() > at Function/http://adobe. com/AS3/2006/ builtin:: apply > <http://adobe.com/AS3/2006/builtin::apply>() > at mx.rpc.remoting. mxml::Operation/ send() > at Function/http://adobe. com/AS3/2006/ builtin:: apply > <http://adobe.com/AS3/2006/builtin::apply>() > at > mx.rpc::AbstractSer vice/http://www.adobe. com/2006/ actionscript/ > flash/pro\ > xy::callProperty > <http://www.adobe.com/2006/actionscript/flash/proxy::callProperty>() > at HelloFromColdFusion /___Button1_ click() > > My services-config. xml file is default, but I have tried some different > settings, restarting my CF server with every change; none worked > successfully. I've tried the default endpoint line and I tried putting > in http://www.[mydomainname] .com/flex2gatewa y. Both throw the same > error. > > <channels> > <channel-definition id="my-cfamf" > class="mx.messaging .channels. AMFChannel" > > <endpoint > uri="http:// {server.name} :{server. port}{context. root}/flex2gatew ay/" > class="flex. messaging. endpoints. AMFEndpoint" /> > > <properties> > <polling-enabled> false</polling- enabled> > <serialization> > <instantiate- types>false< /instantiate- types> > </serialization> > </properties> > </channel-definitio n> > </channels> > > Is anybody using a remote Coldfusion development server with Flex 2 and > Remoting? I'd appreciate ideas to try or solutions to this mystery. I'm > not the type that likes to get super deep into the why and how it works. > I just want it to work so I can start developing my Flex 2/CF app. > > Thanks, > > Jim Pickering > >