WCF with Flash tutorial

前端 未结 1 1938
醉酒成梦
醉酒成梦 2021-02-10 15:35

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

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-10 16:04

    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 讨论(0)
提交回复
热议问题