开发者

WCF with Flash tutorial

开发者 https://www.devze.com 2023-01-08 03:47 出处:网络
I\'m a begin开发者_如何学Goner 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'm a begin开发者_如何学Goner 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?


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号