Hey Thomas,
 
I should point out that you have a few options when connecting to ColdFusion from a Flex 2 application (well, for any Flex 2 application but I'll keep this reply CF focused).
 
The first thing I want to mention is that for RPC services like RemoteObject, and WebService and HTTPService (when using the proxy) you can avoid specifying a services-config.xml file so long as you take on the responsibility of programmatically specifying where the channel endpoint(s) are for a service. I would suggest this approach if you are connecting to an endpoint other than FDS and you're not comfortable futzing with the configuration across two app servers.
 
1. The first way to specify a set of channels that can be tried to find a suitable endpoint to communicate with a destination. This approach is hinted in the docs...
... but to make it more explicit I'll reproduce the relevant ActionScript code here:
 
import mx.messaging.ChannelSet;
import mx.messaging.Channel;
import mx.messaging.channels.AMFChannel;
 
...
var cs:ChannelSet = new ChannelSet();
var customChannel:Channel = new AMFChannel(null, "
http://localhost:8700/cfusion/flex2gateway/");
cs.addChannel(customChannel);
myRemoteObject.channelSet = cs;
...
 
Note that we pass a null channel id to the channel constructor so that we don't have to know what the channel-definition is called in the relevant /WEB-INF/flex/services-config.xml file. The channel id is only to help services catch a mistaken channel assignment which is only really important for publish/subscribe services as if one were to assign a non-polling, non-real-time channel you'd never received pushed updates.
 
Also note this approach should work for other RPC services too (well, it is true for publish/subscribe services too like Producers/Consumers for the FDS message service and the data management services).
 
 
2. Another quick and dirty way to do this for the MXML API of RemoteObject ONLY is to use the legacy endpoint attribute:
 
<mx:RemoteObject id="myRemoteObject" endpoint=http://localhost:8700/cfusion/flex2gateway/  ... />
 
Under the covers the MXML tag will use the endpoint to create a default channel set for you (it'll use AMFChannel for URLs starting with http, and SecureAMFChannel for URLs starting with https).
 
 
Pete
 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Rühl
Sent: Tuesday, October 17, 2006 5:52 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] [Flex 2] Crossdomain issue


I got it, I got it! ...well, almost.

Due to my RPC adaptions to services-config, I configured the
'ColdFusion' destination to be localhost:8500. So, after all, it was my
fault. However, when I began using Coldfusion I remember the {server...}
variables didn't work for some reason.

Well, they do now, what the hell...

Thanks, Peter, for your concern.
Cheers, Thomas

------------------------------------

Thomas Rühl
Design, Programming & Concepts

akitogo OHG
Hanauer Landstrasse 188
60314 Frankfurt

Telefon +49 (0) 69 800 69 445
Fax +49 (0) 69 800 69 449
Mobil +49 (0) 179 750 75 87
E-Mail thomas.ruehl@akitogo.com
Web http://www.akitogo.com

------------------------------------

Peter Farland wrote:
>
>
> This shouldn't matter, but can you try removing the to-ports attribute
> in the crossdomain.xml but leave the domain attribute in the
> allow-access-from element?
>
> Are you using mxmlc to compile the SWF and if so, is there any chance
> that you changed the network access policy when compiling the SWF (i.e.
> set -useNetwork to false if compiled with mxmlc)?
> ----------------------------------------------------------
> *From:* [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com]
> *On Behalf Of *Thomas Rühl
> *Sent:* Monday, October 16, 2006 7:49 AM
> *To:* [EMAIL PROTECTED]ups.com
> *Subject:* [flexcoders] [Flex 2] Crossdomain issue
>
>
> Hello flexcoders,
>
> I am currently failing to access my application by an address other than
> localhost.
>
> The error I get is:
> Client.Error.MessageSend: Send failed
>
> The details are:
> [FaultEvent.fault=[RPC Fault faultString="Send failed"
> faultCode="Client.Error.MessageSend" faultDetail="Channel.Security.Error
> error Error #2048"] messageId="..." type="fault" bubbles=false
> cancelable=true eventPhase=2]
>
> My crossdomain.xml looks like this:
> <?xml version="1.0"?>
>
> <!DOCTYPE cross-domain-policy SYSTEM
> "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd
> <http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd>">
> <cross-domain-policy>
> <allow-access-from domain="*" to-ports="*"/>
> </cross-domain-policy>
>
> And the URL, I am attempting to access is
> http://10.12.104.10:8700/flex/AvalonHelpdesk/AvalonHelpdesk.html
> <http://10.12.104.10:8700/flex/AvalonHelpdesk/AvalonHelpdesk.html>
> ...where 10.12.104.10 is my IP address and 8700 is the FDS port.
>
> I can successfully access the policy file by typing
> http://10.12.104.10:8700/crossdomain.xml
> <http://10.12.104.10:8700/crossdomain.xml>
>
> Everything else, like Coldfusion and the database, as well runs locally
> on my machine. Any attempts using localhost, work just fine.
>
> Any help is really appreciated!
>
> Cheers, Thomas
>
> ------------------------------------
>
> Thomas Rühl
> Design, Programming & Concepts
>
> akitogo OHG
> Hanauer Landstrasse 188
> 60314 Frankfurt
>
> Telefon +49 (0) 69 800 69 445
> Fax +49 (0) 69 800 69 449
> Mobil +49 (0) 179 750 75 87
> E-Mail thomas.ruehl@akitogo.com <mailto:thomas.ruehl%40akitogo.com>
> Web http://www.akitogo.com <http://www.akitogo.com>
>
> ------------------------------------
>
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to