要ASP.NET MVC或REST风格的或WCF REST服务风格、NET、ASP、MVC

由网友(因帅被判十年)分享简介:我的客户提供相关的消费者的购物基于其成员在杂货店习惯的各种数据。 My client provides various data related to a consumers shopping habits in grocery stores based on their membership. 他们的一个厂商要进...

我的客户提供相关的消费者的购物基于其成员在杂货店习惯的各种数据。

My client provides various data related to a consumers shopping habits in grocery stores based on their membership.

他们的一个厂商要进军数据,并建立一个内部网站为公司。我所有的客户愿意提供某种形式的网络服务,使供应商可以使用数据,因为他们需要和使用该数据建立自己的内部网站。

One of their vendors wants to tap into the data and build an intranet site for the company. All my client is willing to provide is some form of web service so that the vendor could consume the data as they need and build their intranet site using that data.

什么是推荐的方式来提供这些数据? 2.0 web服务或某种.NET REST服务或WCF服务?

What would be a recommended way to provide this data? 2.0 webservice or some sort of .NET REST service or WCF service?

的数据存储在SQL

搜索的一个例子,一个假设的搜索可能是获得数据,其中消费者购买的糖和购买馅饼皮某些日期,这可能导致在需要被发送回销售商为他们的消费0..N记录之间。

An example of a search, a hypothetical search could be to get data where consumers bought sugar and bought pie crust between certain dates which could result in 0..n records which need to be sent back to the vendor for their consumption.

推荐答案

虽然WCF是一种简单的方式来获得休息的服务了,特别是如果你是一个.NET客户端消费它,我preFER我自己的滚动使用ASP的MVC服务。

Although WCF is a simple way to get a rest service up, particularly if you are consuming it with a .net client, I prefer rolling my own services using ASP MVC.

它为您提供了更精细地控制您的资源。你可以看HTTP头的认证信息,内容类型等或返回自定义HTTP状态codeS根据操作的结果。你不会被限制在WCF约定。您将有消费服务时多做体力劳动,但我觉得最终的结果是值得的。

It gives you much finer grained control over your resources. You can watch HTTP headers for authentication information, content types, etc or return custom HTTP status codes depending on the result of the action. You won't be constrained to the WCF conventions. You will have to do more manual work when consuming the services, but I feel that the end result is worth it.

阅读全文

相关推荐

最新文章