|
Mailing Lists
|
Home /
Groups /
Adobe Flex
Failing to connect to ColdFusion
I am playing again with Flex after over a year off. I set up a newIan Skinner 01/14/09 04:43 P Are you using Flex Builder? You are probably just not setting your projectDan Vega 01/14/09 04:50 P Dan Vega wrote:Ian Skinner 01/14/09 05:03 P Flash and Flex communicate using an AMF Gateway built into ColdFusion.Jeffry Houser 01/14/09 05:15 P Don't forget the trailing slash on the flex2gateway link ( localhost/flex2gateway/ ) or it will not work eitherGareth Arch 01/14/09 05:34 P Jeffry Houser wrote:Ian Skinner 01/14/09 05:50 P I am playing again with Flex after over a year off. I set up a new project and was proud of myself that I got one set up in just two tries. I can properly serve up simple, static Flex applications. So I moved on to connecting to my ColdFusion for the back end. When I run it now I get this error when I try to call the ColdFusion component. [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://localhost/playground/flex2gateway/'"] "http://localhost/playground/flex2gateway/" is not a valid URL. The proper path to the Flex project is "http://localhost/flex/playground/". But this does not have a 'flex2gateway' under it. I am not sure what this means. I presume I have something missing in my configurations, but I am not sure what. Google searching has told me to look at the compiler arguments of my project: -services "C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\flex\services-config.xml" -locale en_US This seems to be correct. That is the location of my ColdFusion server. Google results also tell me to look at the endpoint in my services.congig.xml file. But which one? There are several in there and I don't see any that are "ColdFusion" as I sort of expected from my RemoteObject MXML tag. <mx:RemoteObject id="cfc" destination="ColdFusion" source="cfcs.foobar"> Are you using Flex Builder? You are probably just not setting your project up correctly. Check out this tutorial I wrote that was part of a bigger project but this step walks you through a basic setup. http://www.danvega.org/blog/index.cfm?mode=entry&entry=9927B08A-3FF4-37A0-036DDF334317ACB5 Thank You Dan Vega danvega@gmail.com http://www.danvega.org ----- Excess quoted text cut - see Original Post for more ----- Dan Vega wrote: > Are you using Flex Builder? You are probably just not setting your project > up correctly. Check out this tutorial I wrote that was part of a bigger > project but this step walks you through a basic setup. > > http://www.danvega.org/blog/index.cfm?mode=entry&entry=9927B08A-3FF4-37A0-036DDF334317ACB5 Yes I am using Flex Builder 2. I also suspect it is a problem with the project set up, but I am unsure what the problem is. I now get an error that seems to point to the right folder by changing the context of my project from 'playground' to 'flex/playground'. But that didn't resolve anything. What I am wondering is if I am having trouble with my server set up. ColdFusion c:/Jrun4/servers/cfusion/ Flex Development Location c:/development/Flex/Playground/ IIS Web Root c:/development/wwwroot/ Flex Project output folder c:/development/wwwroot/flex/playground/ I looked over your link, but there seems to be quite a difference between Flex 2 and Flex 3 in the wizards. Flash and Flex communicate using an AMF Gateway built into ColdFusion. Most of the time it is located at "domain/flex2gateway" so in your case I'd expect it to be "localhost/flex2gateway" . If that URL loads a blank page [as opposed to a 404 error], there is a good chance that the gateway is working properly. Just that your Flex app is looking for the URL in the wrong place. You probably need to open up the Services-Config file and possibly make changes to it. The full path location of services-config should be listed as a compiler parameter in the project properties. Ian Skinner wrote: ----- Excess quoted text cut - see Original Post for more ----- Don't forget the trailing slash on the flex2gateway link ( localhost/flex2gateway/ ) or it will not work either ----- Excess quoted text cut - see Original Post for more ----- Jeffry Houser wrote: > Flash and Flex communicate using an AMF Gateway built into ColdFusion. > Most of the time it is located at "domain/flex2gateway" so in your case > I'd expect it to be "localhost/flex2gateway" . If that URL loads a > blank page [as opposed to a 404 error], there is a good chance that the > gateway is working properly. Thanks, this got me there. I did not need to do anything in my services-config file. On your hint that the path should be "domain/flex2gateway" I removed everything from the 'path' property in my Project Configuration. Thus Flash player was now looking for 'http://localhost/flex2gateway"; *not* "http://localhost/playground/flex2gateway" or "http://localhost/flex/playground" which is what it was looking for before. I then got an error about not being able to find my cfc file and I realized that I need the full path from the root of the site *not* the relative path from the flex/flash page. <mx:RemoteObject id="helloWorld" destination="ColdFusion" source="flex.playground.cfcs.foobar"> I am now connecting to my local ColdFusion server and receiving results from it. Thank You Jaffry and Gareth. Ian Skinner
|
May 25, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||