WCF服务与WCF数据服务的区别
问:
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.
- Can I use both wcf service and data service in a single service. I mean using single service reference.
- Can I add business logic in CRUD operations.
- 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,
WCF服务与WCF数据服务的区别的更多相关文章
- Dynamic CRM 2015学习笔记(4)修改开发人员资源(发现服务、组织服务和组织数据服务)url地址及组织名
在azure vm上安装了CRM 2015后 Dynamic CRM 2015学习笔记(1)Azure 上安装 CRM 2015, 发现了一个问题,那就是在设置 ->自定义项 –> 开发人 ...
- WCF 数据服务 4.5
.NET Framework 4.5 其他版本 WCF 数据服务(以前称为"ADO.NET Data Services")是 .NET Framework 的一个组件.可以使用此组 ...
- Dataphin数据服务系列之--API 配置、管理和消费
研发小哥哥还在为公司里大量 API 只上不下,不可查不可用, 想找的 API 找不到而苦恼吗?业务方小姐姐还在为 API 开发时间长,业务相应不及时而抱怨吐槽吗? 铛铛铛,Dataphin 数据服务 ...
- GIS应用|快速开发REST数据服务
随着计算机的快速发展,GIS已经在各大领域得到应用,和我们的生活息息相关, 但是基于GIS几大厂商搭建服务,都会有一定的门槛,尤其是需要server,成本高,难度大,这里介绍一种在线GIS云平台,帮你 ...
- 如何:加载分页结果(WCF 数据服务)
WCF 数据服务 允许数据服务限制单个响应源中返回的实体数.在此情况下,源中的最后一项包含指向下一页数据的链接.通过调用执行 DataServiceQuery 时返回的 QueryOperationR ...
- [SignalR]SignalR与WCF双工模式结合实现服务端数据直推浏览器端
原文:[SignalR]SignalR与WCF双工模式结合实现服务端数据直推浏览器端 之前开发基于WinForm监控的软件,服务端基于Wcf实现,里面涉及双工模式,在客户端里面,采用心跳包机制保持与服 ...
- WCF契约之---服务契约 、数据契约、 消息契约
本篇博文只是简单说下WCF中的契约的种类.作用以及一些简单的代码示例.在WCF中契约分为服务契约.数据契约和消息契约.下面对这几种契约进行简单的介绍. 服务契约 服务契约描述了暴露给外部的类型(接口或 ...
- 关于WCF的引用,添加服务和添加web服务的区别
原文:关于WCF的引用,添加服务和添加web服务的区别 本章内容主要是根据我做的实验来阐述这2种添加服务针对WCF的不同之处,我们按照示例一步一步来看. 如下是工程的结构: 该WCF服务是通过控制台程 ...
- .net通过WCF调用java发布的服务,获取数据
功能描述 java作为后台,连接数据库获取数据,然后发布SOAP services,让.net平台通过WCF进行引用. 实现步骤 1.在项目特定文件夹下,右键->添加服务引用,输入服务的url地 ...
随机推荐
- VTK初学一,Pro文件的配置
1. pro文件的配置 TEMPLATE = app CONFIG += console CONFIG -= app_bundle CONFIG += qt QT += core gui greate ...
- nyoj 236拦截导弹 简单动归(java)
C/C++: #include<stdio.h> int main() { // freopen("250.txt","r",stdin); ],b ...
- SpringMVC 表单标签
引入标签库 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" ...
- Effective Java 读书笔记之五 枚举和注解
Java1.5中引入了两个新的应用类型家族,新的类为枚举类型,新的接口为注解类型. 一.用enum代替int常量 1.枚举值由一组固定的常量组成合法值的类型. 二.用实例域代替序数 1.不要根据枚举的 ...
- sql server 2008 R2 不允许保存更改,您所做的更改要求删除并重新创建以下表
点击菜单栏 [工具]->[选项] 进入如下界面: 将阻止保存要求重新创建表的更改 的勾去掉即可.
- Android 趣味应用—— 短信编辑器
修改短信数据库,从而生成任意手机号发送的短信. AndroidManifest.xml <?xml version="1.0" encoding="utf-8&qu ...
- css选择器(E[att^=”val”]序号选择器)
一.基本选择器序号 选择器 含义1. * 通用元素选择器,匹配任何元素2. E 标签选择器,匹配所有使用E标签的元素3. .info class选择器,匹配所有class属性中包含info的元素4. ...
- 34 网络相关函数(二)——live555源码阅读(四)网络
34 网络相关函数(二)——live555源码阅读(四)网络 34 网络相关函数(二)——live555源码阅读(四)网络 2)socketErr 套接口错误 3)groupsockPriv函数 4) ...
- 深入mysql "on duplicate key update" 语法的分析
如果在INSERT语句末尾指定了on duplicate key update,并且插入行后会导致在一个UNIQUE索引或PRIMARY KEY中出现重复值,则在出现重复值的行执行UPDATE:如果不 ...
- weiphp执行的流程
微信交互 1.用户与微信进行交互,交互的事件包括:回复公众号,扫描与公众号有关的二微码,关注(取消关注)公众号,在公众号里点击自定义菜单等 2.微信把用户的交互事件及相关参数传递给weiphp的微 ...