我应该为Silverlight 2数据使用哪种类型的服务?

时间:2022-09-08 17:15:28

There is ASMX, WCF, REST, and ADO.NET Data Services... I've used WCF and ASMX succesfully with Silverlight 2, but what about the others? What are the pros and cons of using each type of service with Silverlight 2?

有ASMX,WCF,REST和ADO.NET数据服务......我已经成功地使用了Silverlight 2的WCF和ASMX,但其他的呢?使用Silverlight 2的每种服务有哪些优缺点?

3 个解决方案

#1


You have multitude of options -

你有很多选择 -

  1. RESTful webservice (if u need more than just CRUD) + ADO.net Data Service (Data)
  2. RESTful webservice(如果你需要的不仅仅是CRUD)+ ADO.net数据服务(数据)

  3. The Tried and tested ASMX
  4. 经过试验和测试的ASMX

  5. Build an all in one WCF service that uses SOAP/HTTP/TCP/JSON/Your custome binding
  6. 构建使用SOAP / HTTP / TCP / JSON /您的客户绑定的一体化WCF服务

Number 3 is my personal choice.

3号是我个人的选择。

#2


WCF is probably what you want, since it is a framework that includes http, soap, tcp, json, etc.

WCF可能就是你想要的,因为它是一个包含http,soap,tcp,json等的框架。

#3


Depending on your intent a few things you must also take into consideration:

根据您的意图,您还必须考虑以下几点:

  1. RESTful web services are supported by ADO.NET Data Services as well as many other non-Microsoft platforms.

    ADO.NET Data Services以及许多其他非Microsoft平台都支持RESTful Web服务。

  2. WCF Web services must include a policy xml file and support more enhanced but Microsoft specific implementations of WS-* (WS "deathstar" if you want my opinion)

    WCF Web服务必须包含策略xml文件并支持更多增强但是特定于WS- *的Microsoft特定实现(WS“deathstar”,如果您需要我的意见)

  3. ASMX web services are simple but lack the security model built around WCF (either RESTful or SOAP based).

    ASMX Web服务很简单,但缺少围绕WCF构建的安全模型(基于RESTful或基于SOAP)。

If you want to do fast prototyping, I would recommend using ASMX services since they involve the least amount of effort. If you are doing something that involves a lot of database interaction, consider using ADO.NET Data Services and a RESTful approach. If you would like to add a lot of complexity, but benefit from more robust security and configuration, utilize WCF.

如果您想进行快速原型设计,我建议使用ASMX服务,因为它们涉及的工作量最少。如果您正在做涉及大量数据库交互的事情,请考虑使用ADO.NET数据服务和RESTful方法。如果您想增加很多复杂性,但从更强大的安全性和配置中受益,请使用WCF。

#1


You have multitude of options -

你有很多选择 -

  1. RESTful webservice (if u need more than just CRUD) + ADO.net Data Service (Data)
  2. RESTful webservice(如果你需要的不仅仅是CRUD)+ ADO.net数据服务(数据)

  3. The Tried and tested ASMX
  4. 经过试验和测试的ASMX

  5. Build an all in one WCF service that uses SOAP/HTTP/TCP/JSON/Your custome binding
  6. 构建使用SOAP / HTTP / TCP / JSON /您的客户绑定的一体化WCF服务

Number 3 is my personal choice.

3号是我个人的选择。

#2


WCF is probably what you want, since it is a framework that includes http, soap, tcp, json, etc.

WCF可能就是你想要的,因为它是一个包含http,soap,tcp,json等的框架。

#3


Depending on your intent a few things you must also take into consideration:

根据您的意图,您还必须考虑以下几点:

  1. RESTful web services are supported by ADO.NET Data Services as well as many other non-Microsoft platforms.

    ADO.NET Data Services以及许多其他非Microsoft平台都支持RESTful Web服务。

  2. WCF Web services must include a policy xml file and support more enhanced but Microsoft specific implementations of WS-* (WS "deathstar" if you want my opinion)

    WCF Web服务必须包含策略xml文件并支持更多增强但是特定于WS- *的Microsoft特定实现(WS“deathstar”,如果您需要我的意见)

  3. ASMX web services are simple but lack the security model built around WCF (either RESTful or SOAP based).

    ASMX Web服务很简单,但缺少围绕WCF构建的安全模型(基于RESTful或基于SOAP)。

If you want to do fast prototyping, I would recommend using ASMX services since they involve the least amount of effort. If you are doing something that involves a lot of database interaction, consider using ADO.NET Data Services and a RESTful approach. If you would like to add a lot of complexity, but benefit from more robust security and configuration, utilize WCF.

如果您想进行快速原型设计,我建议使用ASMX服务,因为它们涉及的工作量最少。如果您正在做涉及大量数据库交互的事情,请考虑使用ADO.NET数据服务和RESTful方法。如果您想增加很多复杂性,但从更强大的安全性和配置中受益,请使用WCF。