How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF. I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious.
If you're pressed for time, you can just use the RemoteObject to hit a compiled DLL (like WebORB - its free for .NET, but you need a VS copy above Express to compile your classes that you want to expose to Flex)
and Retrieve the object that way...
Obviously your objects should have a DAL in place or be generated so you can communicate with your database.
But i suggest using Cairngorm for any data intensive Flex application. It isn't simple and development won't feel as fast, but once you understand it, things go alot smoother and it just feels right. I could go into the details, but there are people that are much smarter than I am that have already explained it, in depth. Someone like yourself should be able to grasp the concepts pretty quickly.
here are the links to learning WebORB and Cairngorm:
- weborb : http://www.themidnightcoders.com/weborb/
- cairngorm : http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm
- learning Cairngorm : http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html
One minor correction to the answer above: you can actually use the Express edition to compile your assembly. With WebORB you can simply deploy your DLLs into the /bin folder of the virtual directory and it will take care of enabling your classes as Flex Remoting services. You do not need to implement any special interfaces or use any special attributes. Just create a class that returns the data you want to deliver to the client, deploy that class into weborb and use the RemoteObject API on the client side. Here's a link to the getting started article:
An alternative to WebORB for .Net AMF remoting is FlourineFx. I haven't used it, but it looks interesting. I have used WebORB which is quite powerful. It has some great code generation tools which speed up the process of building a database driven application.
I would definetely check WebORB and the MSMQ support (FluorineFX has the same functionality. Both are free). You could let WebORB listen to a certain queue in MSMQ. On the flex side you would need to create a Consumer and suscribe it to that queue. WebORB will then push every message in the queue to all the Consumers created in the swf. Other applications like your ASP.NET application could put messages in that queue (serialized objects or xml for instance) and will be delivered to your Flex GUI.
I wrote some posts on the subect on http://blog.johlero.eu.
Another very good example is at http://www.themidnightcoders.com/articles/msmqtoflexdatapush.shtm where they use a Windows Form Application to send messages to a flex Gui.
Lieven Cardoen aka Johlero