WCF与Flash教程 [英] WCF with Flash tutorial

查看:148
本文介绍了WCF与Flash教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WCF的初学者,我选择了Web服务,而不是Web服务,因为我读过的所有文章和博客似乎都指出,ASMX是旧的新闻。



我已经读了一些旧的Web服务和WCF之间的差异,我得到了一般的想法。我也采取了 MSDN WCF教程,这似乎很简单。 p>

我的问题是我想创建可以被Flash使用的WCF服务。我读过,它是可以随处可用的,但没有明确的AZ教程如何进行服务器端和客户端...只是一些建议。



任何人都可以指向正确的方向,我可以在我面前的选项的简要说明?

解决方案

我们这样做与我们的游戏,我们有一堆的WCF服务提供不同的功能,以运行在Facebook / MySpace的Flash客户端等。



我建议你应该先看看这个codeplex项目:



http://wcfflashremoting.codeplex。 com /



它允许你实现一个AMF端点来与Flash客户进行通信。

所有的DataContract都需要完全映射,包括名称空间和属性名称,所以如果你有一个MyProject.Contracts.Requests.HandShakeRequest对象在你的WCF项目中,Flash客户端需要在SAME命名空间中定义一个复制。



另一个我们发现非常有用的是请求/响应模式,因为它允许添加/删除参数/输出值,并具有相当数量的向后兼容性 - 为服务器上的Request对象添加新参数以实现新功能,并且客户端不必立即发送新参数。



对于调试你绝对需要查尔斯( http://www.charlesproxy.com ),最新的版本应该有AMF查看器工作正常(我想你以前必须下载一个加载项),这样你就可以看到从服务器以一个很好的,可读的格式返回的AMF消息。 p>

希望这有助于!在使用WCF的Flash客户端时还有一些其他的注意事项,但不能记住他们的头顶上:-P所以有一个与远程扩展玩耍,我会弹出一些其他位和bobs下来,当我可以记住他们!


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?

解决方案

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!

这篇关于WCF与Flash教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆