特定于 Silverlight 的 WCF 服务选项
我对应该创建哪种类型的 WCF 服务感到困惑。 Visual Studio 为我提供的选项是
- 在我的 silverlight 解决方案中添加新的 WCF 服务应用程序项目
- 添加启用 Silverlight 的 WCF 服务
- Ajax 启用的 WCF 服务
- WCF 数据服务
- WCF 服务
最后四个是 WCF 服务,我可以将其添加到充当以下角色的 Web 项目中:托管我的 silverlight 应用程序;通常是 MySilverlightProject.Web。
所以我的问题是:
- 我如何选择最好的 一。我应该成为什么 在我去买之前先检查一下 超过另一个?
- 我应该创建一个单独的项目吗 包含所有服务还是只是将其添加到充当我的 silverlight 应用程序主机的 Web 项目中?
- 有没有一些简洁的文档 可以告诉我有关 这些不同类型中的每一个 服务创建选项。我想要 知道为什么我们得到这么多 不同的选择。
截至目前,我知道我不想创建一个安静的服务,所以让我们从那里取出 WCF 数据服务。从其余的中,我如何决定选择哪一个?我希望它是安全的,所以我肯定会选择 wsHTTP 绑定。我还想从客户端发送自定义标头,以便只有有效的应用程序才能使用该服务。
I am getting confused as to which type of of WCF service I should create. The options that Visual Studio gives me are
- Adding a new WCF Service application project to my silverlight solution
- Adding a Silverlight enabled WCF service
- Ajax enabled WCF service
- WCF Data Service
- WCF Service
The last four being WCF services I can add to the web project that acts as host to my silverlight application; typically MySilverlightProject.Web.
So my questions are:
- How do I choose what is the best
one. What are the things I should be
checking off before I go for one
over the other? - Should I create a separate project
that contains all services or just add it to the web project that acts as host to my silverlight application? - Is there some concise documentation
available that can tell me about
each of these different types of
service creation options. I want to
know why we were given so many
different choices.
As of now I know I dont want to create a restful service, so lets pull out the WCF Data service from there. From the rest, how do I decide which one to go for? I want it to be secure so I will choose the wsHTTP binding for sure. I also want to send custom headers from the client so that only valid applications can consume the service.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有“最好”的。只有适合您情况的“最佳”方案。 Silverlight 客户端将是唯一使用此服务的客户端吗?如果是这样,我建议使用 .NET RIA 服务,它隐藏了所有管道,让您更快地启动和运行。我曾经参与过不使用 RIA 服务的项目,并发现很多挫败感,并且花费了很多时间来弄清楚所有的管道代码。当然,我有一个很好的独立服务,许多类型的客户都可以使用。我确实将所有内容都放在单独的项目中,并且为了文档,使用了许多不同的来源。主要是其他开发人员的博客文章。我希望这有一些帮助。
There is no "best" one. There is only the "best" one for your situation. Will Silverlight clients be the only ones that consume this service? If so, I would recomend using .NET RIA Services which hides all the plumbing and gets you up and running so much faster. I have worked on projects that don't use RIA services and found a lot of frustrations and time spent figuring out all the plumbing code. But of course, I had a nice stand alone service that many types of clients could consume. I did put everything in seperate projects and for documentation, used many different sources. Mostly other developers blog posts. I hope this is of some help.