If you’re like me, then you’ve gotten well into flash remoting as a solution for Flex Data Messaging. You’re using AMF to allow the creation of remote objects between actionscript on the client and some server language (PHP, Java, .NET, etc).
I’ve been running into troubles with WebORB (v3.5) and setting channels that work.
Essentially, for whatever reason, my compiled app didn’t register the changes in my services-config.xml file that resides in the WEB-INF folder of whatever software you’re using to interface with the server side language. And believe me, I tried it a thousand different ways.
The easiest way to override this faulty behaviour is to set the channels and endpoints inside your flex app when you’re building the remote object.
You can see below a solution in weborb for .NET (hence the weborb.aspx endpoint)
protected static function init(serviceName:String, isSecure:Boolean = false):void
var remoteObject:RemoteObject = null;
var channelSet:ChannelSet = new ChannelSet();
destination = “MySecureDestination”;
channel = new SecureAMFChannel(null,”weborb.aspx”);
destination = “MyDestination”;
channel = new AMFChannel(null,”weborb.aspx”);
remoteObject = new RemoteObject(destination);
//30s timeout on requests
remoteObject.requestTimeout = 30;
remoteObject.showBusyCursor = true;
remoteObject.source = “My.Name.Space.” + serviceName;
remoteObject.channelSet = channelSet;
And in my remoting-config.xml file:
<channel ref=”my-secure-amf” />
As you first start using the SSL option, you may find you start receiving an error about cross domain security issues between HTTP and HTTPS. The deal is that if you are loading your SWF from HTTP, you require a crossdomain.xml policy file in the root of your website to allow HTTPS access.
From Adobe Flex 3 Help: crossdomain.xml
<allow-access-from domain=”*.mydomain.com” secure=”false”/>
As the Help mentions, you don’t require the crossdomain policy if you’re calling HTTP from a HTTPS loaded swf.