开发者

WCF Service options specific to Silverlight

开发者 https://www.devze.com 2023-03-08 03:44 出处:网络
I am getting confused as to which type of of WCF service I should create. The options that Visual Studio gives me are

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:

  1. 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?
  2. 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?
  3. 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 onl开发者_如何学Cy valid applications can consume the service.


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.

0

精彩评论

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

关注公众号