Learning WCF Chapter2 Service Description
While messaging protocols are responsible for message serialization formats,
there must be a way to capture the protocols required to communicate between clients and services.
In Chapter 1,you worked with WSDL documents,which describe the requirements of a service,
including the operations associated with each endpoint and the protocols used by each endpoint.
In this section,I’ll discuss the relationship between the service description, message exchange patterns, and WSDL.
Service Description
Services may implement one or more endpoints,each possibly supporting a different set of operations,messaging protocols,message encoding formats,and transport protocols.
Collectively,this information about a service is part of the service metadata,as I discussed in Chapter 1.
This can also be referred to as the service description.
In fact,WCF represents this information at runtime as a ServiceDescription type from the System.ServiceModel namespace.
The ServiceDescription type is a runtime representation of
all service endpoints and their associated service contracts,
the binding configuration that describes protocol support,
and local behaviors that affect how the service model processes messages.
It is the ServiceDescription type that is used to generate the WSDL document,
and it also supports dynamic metadata exchange so that clients can discover at runtime what protocols are required to invoke service operations.
Recall from Chapter 1 that SvcUtil is used to generate proxies for clients by consuming a WSDL document or using dynamic metadata exchange,
which is based on WS-MetadataExchange protocol (see Figure 2-1).

Figure 2-1. SvcUtil can generate proxies from a WSDL document or by using dynamic metadata exchange
WSDL
SOAP protocol defines the basic requirements to allow platforms to process SOAP messages,extracting headers and body elements to perform work.
Obviously,to understand the header and body elements,the platform also needs to know the format of those elements.
That’s where WSDL comes in.
WSDL describes the core messaging requirements for communicating with a service.
As you learned in Chapter 1,an XML document describes a service,its available endpoints and associated addresses,the protocols supported by each endpoint,and the list of operations and messages associated with each endpoint.
It includes XSD schema describing each message and the contents of the message.
While the message is framed in SOAP,WSDL describes the application-specific schema for each header and each body element.
In this chapter,I’ll be discussing how service contracts and data contracts contribute to the WSDL document.
WSDL is enough to describe application messaging requirements;
however,it is not enough to describe other protocol support related to WS*,for example.
That’s where WS-Policy comes in.
WS-Policy
WS-Policy is an interoperable standard for describing extended protocol requirements,or policy,for a particular endpoint.
The WS-Policy specification describes how to include policy in the WSDL document either directly or as an attachment(actually, that specification is called WS-PolicyAttachment).
While policy does not have an effect on the business messages exchanged between clients and services,
it does affect how the plumbing provided by the service model builds and serializes messages.
WS-Policy extensions exist for security,transactions,reliable messaging,sessions,
and other features that are defined by attributes applied to the service contract or through binding configuration.
Most aspects of the binding configuration are shared with clients through the policy section of the WSDL document,
enabling clients to build an equivalent channel stack to call services.
Note:
Throughout this book as I discuss bindings (Chapter 3) and other features related to security and reliability, I’ll discuss policy-related features.
WS-MetadataExchange
WS-MetadataExchange is a standard protocol that defines how to retrieve some or all of the service description at runtime.
This includes retrieving the contents of the entire WSDL document or possibly retrieving specific policy requirements related to security, for example. SvcUtil uses this protocol to generate proxies.
Learning WCF Chapter2 Service Description的更多相关文章
- Learning WCF Chapter2 Service Contracts
A service contract describes the operations supported by a service,the message exchange pattern they ...
- Learning WCF Chapter2 Data Contracts
A data contract describes how CLR types map to XSD schema definitions. Data contracts are the prefer ...
- Learning WCF Chapter2 Messaging Protocols
In Chapter 1,you were introduced to fundamental WCF concepts, 在章节1中,学习了wcf中的基础概念including how t ...
- Learning WCF Chapter2 WCF Contracts and Serialization
So far I’ve talked about the standards behind it all,but in fact WCF hides most of this from the dev ...
- Learning WCF Chapter1 Hosting a Service in IIS
How messages reach a service endpoint is a matter of protocols and hosting. IIS can host services ov ...
- Learning WCF Chapter1 Generating a Service and Client Proxy
In the previous lab,you created a service and client from scratch without leveraging the tools avail ...
- Learning WCF Chapter1 Exposing Multiple Service Endpoints
So far in this chapter,I have shown you different ways to create services,how to expose a service en ...
- TinyFrame升级之十:WCF Rest Service注入IOC的心
由于在实际开发中,Silverlight需要调用WebService完成数据的获取,由于之前我们一直采用古老的ASMX方式,生成的代理类不仅难以维护,而且自身没有提供APM模式的调用方式,导致在Sin ...
- WCF Windows Service Using TopShelf and ServiceModelEx z
http://lourenco.co.za/blog/2013/08/wcf-windows-service-using-topshelf-and-servicemodelex/ There are ...
随机推荐
- CSS3兼容IE的大杀器
经过长久以来的不懈努力,我终于成功的将selectivizr与PIE这两个解决css3的利器进行了深度的整合,大大降低了使用难度 <!--[if lte IE 9]><script ...
- 关于dialog引起的 java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView not attached to window manager 错误的分析
在跑Monkey测试的时候出现了一个比较特别的问题,先来看看Log: // CRASH: com.meizu.media.painter (pid 12491) // Short Msg: java. ...
- Sidebar Enhancements使用说明
SideBarEnhancements是Sublime侧栏文件与文件夹的增强工具 Version: 2015.5.27 通过使用Sumbime Text3安装包工具(Package Control,快 ...
- Java_类和对象(完美总结)_转载_覆盖和隐藏的区别,覆盖就不能使用了,而隐藏提供全局方法名或者全局变量名还可以使用
转载自海子:http://www.cnblogs.com/dolphin0520/p/3803432.html Java:类与继承 对于面向对象的程序设计语言来说,类毫无疑问是其最重要的基础.抽象.封 ...
- oracle定时备份
1.将如下代码复制到文本中,最后将文本后缀名称修改成XXX.bat 批处理文件: *********************************************************** ...
- 500 OOPS: cannot change directory:/home/test
问题: 以root 从远程客户端 登录 FTP 一直密码错误. 发现不能以root 登录, 需要创建其它的用户. 创建一个test 用户后(如下): useradd test; passwd ...
- Library string Type
The string type supports variable-length character strings.The library takes cares of managing memor ...
- Linux下的visudo命令
新建了一个test账号,su 后使用visudo命令,发现不可用,退出putty,直接用root登录,可以用了,小白了,visudo只能用root执行,简单写下visudo命令吧 visudo后得到的 ...
- 常用js函数
1.获得元素到页面的绝对距离 function getPos(obj) { var pos = {left:0, top:0}; while (obj) { pos.left += obj.offse ...
- linux下安装phpredis
一.redis安装 1. yum install redis (不行的先执行:yum install epel-release,再yum install redis) 2.启动服务 redis-ser ...