tags:

views:

156

answers:

2

Hello,

I'm a beginner in WCF, which I have chosen instead of Web Services because all articles and blogs I've read seem to point out that ASMX is old news.

I have read a bit about the differences between old Web Services and WCF, and I got the general idea. I also took the MSDN WCF tutorial which seemed simple enough.

My problem is that I want to create WCF services that can be consumed by Flash. I've read that it's doable everywhere, but with no obvious A-Z tutorial on how to proceed with the server-side and client-side... Just some suggestions.

Can anyone point me to the right direction, with a brief explanation of the options available in front of me?

+2  A: 

Check HERE. Of course not a tutorial, but at least some guidance.

Incognito
+3  A: 

We do this with our games where we have a bunch of WCF services provide different functionalities to the Flash clients running in Facebook/MySpace, etc.

I suggest you should first have a look at this codeplex project:

http://wcfflashremoting.codeplex.com/

It allows you to implement a AMF endpoint for communicating with the Flash clients.

All your DataContract need to be mapped exactly including namespace and property names on both sides, so if you have a MyProject.Contracts.Requests.HandShakeRequest object in your WCF project the Flash client needs to have a replicate defined in the SAME namespace.

Another which we find very helpful is the request/response pattern because it allows to add/remove parameter/output values easily and have a fair amount of backward compatibility - add a new parameter to the Request object on the server for a new feature and the client doesn't HAVE TO send the new parameter right away.

For debugging you absoluately need Charles (http://www.charlesproxy.com), the latest version should have the AMF viewer working properly (I think you used to have to download an add-in) so you can see the AMF messages coming back from the server in a nice, readable format.

Hope this helps! There are some other caveats around working with a Flash client from WCF but can't remember them off the top of my head :-P so have a play around with that remoting extension and I'll pop some other bits and bobs down when I can remember them!

theburningmonk
Hey, I was just about to post about wcfflashremoting - I built it! Glad to hear you like it, I'm hoping that I'll have some time to update it in the coming month to provide some better error messaging so Charles won't be AS necessary. If you have any specific questions, I'm quite active on the discussion board there, as your posts go to my work email. Got a few tutorials here: http://wcfflashremoting.codeplex.com/documentation
mattdekrey
Good to hear from ya! Been using it for a while now and it works great for our purpose :-)One thing we're looking at right now though, is adding HTTP compression to the messages sent/received by the server to cut down on the size of messages. Do you have any plans to add that in the future, or know a way to add compression to the existing FlashRemoting endpoint?
theburningmonk