问:

Hi, I am newbie to wcf programming and a little bit confused between WCF Service and WCF Data  Service. Can someone please explain me these two service types. Can we use them alternatively or each one has its one well-defined specific area to use. Thanx in advance.

答:

WCF Services are operation centric - the main thing you do with these is define operations (functions). Data comes as a secondary thing in a way. On the other hand they can work over lot of different transports/protocols. You have the ability to strictly define what the client can and can not do. Client can't really make up new queries/operations, the server must implement everything the client needs.

WCF服务是以操作为中心的,你主要做的事情就是定义不同的操作(函数),数据放在一个次要的位置。另一方面,他们可以在许多不同的协议下工作。你可以严格的定义,客户端能做什么,不能做什么。客户端不能自己定义新的查询/操作,服务端必做实现客户端所要求的一切。

WCF Data Services are data centric - the main thing you do with these is define a data model to be exposed. Operations on the data are "predefined" (Create/Delete/Update/Read). It only supports HTTP protocol and uses REST. You usually allow clients to decide what they want to do (in some boundaries). One of the main differences from WCF Service is that the client can issue a query against the data model (think SQL like stuff) which the client constructs. This means that the server doesn't need to know exactly what the client needs up front, the client will be able to tell it runtime.

WCF数据服务是以数据为中心。你主要做的事情就是定义一个数据模型,并暴露出去。对数据的操作是“预定义”(创建/删除/更新/读取)。它仅支持HTTP协议和使用REST。允许客户端来决定他们想要做什么(在某些界限下)。一个与WCF服务的主要区别是,客户端可以对数据模型发起一个类型SQL的查询。这意味着服务端并不需要预先知道客户的需要,客户端将能够在运行时告诉它。

问:

Thanx for your response. It clears confusion i had in my mind. I appreciate if u please answer my following questions to further clarify the concepts.

  1. Can I use both wcf service and data service in a single service. I mean using single service reference.
  2. Can I add business logic in CRUD operations.
  3. Can I create service operations in wcf data service similar to what I can create in WCF service. (What I know is in wcf data service i can create service operations but they are very limited and allows only primitive data types as parameters.

Thanks

答:

Hi,

1. No - WCF Services and WCF Data Services need to be exposed as two different endpoints currently and as a result you need to service references on the client. The other reason is that the client classes generated for them are quite different and currently would not work together.

2. You can add bussiness logic to CRUD operations in general. The limitations depend on the actual provider and implementation of the WCF Data Service. Without knowing your requirements on what the bussiness logic should do and what provider you're going to use it's very hard to tell yes or no.

3. Service operations in WCF Data Services are indeed limited. You can't get the full power of WCF Services here.

Thanks,

原文地址:http://social.msdn.microsoft.com/Forums/en-US/687426d9-709f-4e73-8c4c-dd3630f006e7/wcf-data-service-or-wcf-service?forum=adodotnetdataservices

WCF服务与WCF数据服务的区别的更多相关文章

  1. Dynamic CRM 2015学习笔记(4)修改开发人员资源(发现服务、组织服务和组织数据服务)url地址及组织名

    在azure vm上安装了CRM 2015后 Dynamic CRM 2015学习笔记(1)Azure 上安装 CRM 2015, 发现了一个问题,那就是在设置 ->自定义项 –> 开发人 ...

  2. WCF 数据服务 4.5

    .NET Framework 4.5 其他版本 WCF 数据服务(以前称为"ADO.NET Data Services")是 .NET Framework 的一个组件.可以使用此组 ...

  3. Dataphin数据服务系列之--API 配置、管理和消费

    研发小哥哥还在为公司里大量 API 只上不下,不可查不可用, 想找的 API 找不到而苦恼吗?业务方小姐姐还在为 API 开发时间长,业务相应不及时而抱怨吐槽吗? 铛铛铛,Dataphin 数据服务 ...

  4. GIS应用|快速开发REST数据服务

    随着计算机的快速发展,GIS已经在各大领域得到应用,和我们的生活息息相关, 但是基于GIS几大厂商搭建服务,都会有一定的门槛,尤其是需要server,成本高,难度大,这里介绍一种在线GIS云平台,帮你 ...

  5. 如何:加载分页结果(WCF 数据服务)

    WCF 数据服务 允许数据服务限制单个响应源中返回的实体数.在此情况下,源中的最后一项包含指向下一页数据的链接.通过调用执行 DataServiceQuery 时返回的 QueryOperationR ...

  6. [SignalR]SignalR与WCF双工模式结合实现服务端数据直推浏览器端

    原文:[SignalR]SignalR与WCF双工模式结合实现服务端数据直推浏览器端 之前开发基于WinForm监控的软件,服务端基于Wcf实现,里面涉及双工模式,在客户端里面,采用心跳包机制保持与服 ...

  7. WCF契约之---服务契约 、数据契约、 消息契约

    本篇博文只是简单说下WCF中的契约的种类.作用以及一些简单的代码示例.在WCF中契约分为服务契约.数据契约和消息契约.下面对这几种契约进行简单的介绍. 服务契约 服务契约描述了暴露给外部的类型(接口或 ...

  8. 关于WCF的引用,添加服务和添加web服务的区别

    原文:关于WCF的引用,添加服务和添加web服务的区别 本章内容主要是根据我做的实验来阐述这2种添加服务针对WCF的不同之处,我们按照示例一步一步来看. 如下是工程的结构: 该WCF服务是通过控制台程 ...

  9. .net通过WCF调用java发布的服务,获取数据

    功能描述 java作为后台,连接数据库获取数据,然后发布SOAP services,让.net平台通过WCF进行引用. 实现步骤 1.在项目特定文件夹下,右键->添加服务引用,输入服务的url地 ...

随机推荐

  1. Linux中服务器软件为什么需要编译安装

    为什么服务器软件需要编译安装?一个流传很广的说法是编译安装性能更好,其实这是个谣言. 服务器CPU事实已经被Intel垄断了,就那么几种型号,编来编去生成的机器码是一样的.Intel宣传自己的编译工具 ...

  2. WCF绑定类型选择

    WCF绑定类型选择   发布日期:2010年12月10日星期五 作者:EricHu   在开发WCF程序时,如何选择一个适合的绑定对于消息传输的可靠性,传输模式是否跨进程.主机.网络,传输模式的支持. ...

  3. 第四天 rxcocoa

    HackerNewsReaderDemo HackerNewsAPI.sharedApi.newStories() .observeOn(ConcurrentDispatchQueueSchedule ...

  4. springMVC之配置

    1.项目结构 2.所需jar包 3.web.xml文件 <?xml version="1.0" encoding="UTF-8"?> <web ...

  5. java常量池存放在哪里

    运行以下方法: public class Test { public static void main(String[] args) { String str = "abc"; c ...

  6. 开源多线程性能测试工具-sysbench

    导读 sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试.数据库目前支持MySQL/Oracle/PostgreSQL.本文主要演示Mysql测试 ...

  7. OpenCV人形检测Hog

    #include "iostream" #include "queue" using namespace std; #include "opencv2 ...

  8. POJ 3281 网络流dinic算法

    B - Dining Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit S ...

  9. IDEA 进入到项目的系统文件路径

    选中项目,单击右键,在弹出的菜单中点击file path

  10. ITIL与ITSM的联系与区别

    1.ITIL(IT Infrastructure Library)是CCTA(英国国家计算机和电信局)于20世纪80年代末开发的一套IT服务管理标准库,它把英国各个行业在IT管理方面的最佳实践归纳起来 ...