问:

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. [整理]AngularJS学习资源

    https://angular.io/docs/js/latest/(2.0官方网站) http://www.linuxidc.com/Linux/2014-05/102139.htm(Angular ...

  2. CSS这些代码你都不会,你还有什么好说的!!!

    都说自己工资低的,先看看这些代码你能写出来不?这些都不会,你还嫌工资? 很多人抱怨工资低,觉得自己大材小用,但你真的是才不是柴嘛?? 经常听到一些人,遇到不会的问百度,如果这样,我们都不用学习了,天天 ...

  3. GATK软件介绍

    背景介绍 GATK全称是The Genome Analysis Toolkit,是Broad Institute(The Broad Institute, formerly the Broad Ins ...

  4. 【bzoj3631】[JLOI2014]松鼠的新家

    题目描述 松鼠的新家是一棵树,前几天刚刚装修了新家,新家有n个房间,并且有n-1根树枝连接,每个房间都可以相互到达,且俩个房间之间的路线都是唯一的.天哪,他居然真的住在"树"上.松 ...

  5. Android 4.4以上的存储读写权限

    最近遇到一个奇怪现象,直接往Android的SD卡根目录写入文件,报异常:open failed EACCES:permission denied. 已经在manifest.xml中加入android ...

  6. CSS3圆角边框的使用-遁地龙卷风

    0.快速入门 border-radius:50px; 1.border-radius详解 border-radius:50px; 上右下左,水平和垂直距离都是50px border-radius:50 ...

  7. Xcode 6制作动态及静态Framework和各种坑

    Xcode 6制作动态及静态Framework http://www.cocoachina.com/ios/20141126/10322.html 有没有写SDK或者要将一些常用的工具类做成Frame ...

  8. HTML5的新特性及技巧分享总结

    原文链接:http://www.aseoe.com/show-10-645-1.html?utm_source=tuicool&utm_medium=referral 1. 新的Doctype ...

  9. native2ascii.exe

    native2ascii.exe 是 Java 的一个文件转码工具,是将特殊各异的内容 转为 用指定的编码标准文体形式统一的表现出来,它通常位于 JDK_home\bin 目录下,安装好 Java S ...

  10. MVPHelper

    在MVP的使用过程中,我们需要反复的去写各种MVP的接口和实现类, 实在是 太麻烦了!!所以抽时间撸了一款插件(只可用于Intellj IDEA 和 Android Studio),用于生成MVP接口 ...