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 ...
随机推荐
- 使用Azure Redis Cache
通过上一篇博客<Redis Cache 简介>我们已经简单了解了Azure Redis Cache,这里就不过多赘述了. 1.创建Redis Cache 创建Redis Cache之前,我 ...
- ibatis调存储过程返回游标
http://blog.sina.com.cn/s/blog_6f3ca78f01010pmj.html iBatic调用与JAVA调用很类似,只是JAVA把参数的注册放到了类里面,而iBatis把参 ...
- ReactiveCocoa 谈谈RACMulticastConnection
本文出处:http://www.cnblogs.com/forkasi/p/4886740.html 在项目里,经常会使用这种方式创建一个signal 然后next RACSignal *four = ...
- iOS开发-自动布局篇:史上最牛的自动布局教学!
转载自:http://www.jianshu.com/p/f6cf9ef451d9 本文我们将提到: aotulayout(手码) VFL aotulayout(Xib) Masonry(第三方框架) ...
- javascript 基础1第11节
<html> <head> <title>javascript基础</title> </head> <body> 1.NaN i ...
- H5之canvas简单入门
<canvas></canvas>是html5出现的新标签,像所有的dom对象一样它有自己本身的属性.方法和事件,其中就有绘图的方法,js能够调用它来进行绘图 <canv ...
- 例子: 自制Flask首页导航.
# -*- coding:utf-8 -*- ''' Created on 2015年10月19日 ''' from flask import Flask, render_template impor ...
- storm学习之入门篇(二)
Strom的简单实现 Spout的实现 对文件的改变进行分开的监听,并监视目录下有无新日志文件添加. 在数据得到了字段的说明后,将其转换成tuple. 声明Spout和Bolt之间的分组,并决定tup ...
- c#中创建类(更新中)
类是最常见的一种引用类型,最简单的定义如下 class YouClassNam {} 复杂的类可能包含一下内容 类属性 类属性以及类修饰符. 非嵌套的类修饰符有:public,internal,ab ...
- ES6 语法简介
参考: http://es6.ruanyifeng.com/ 总结学习 JavaScript语言下一代标准,2015年6月正式发布. 1.let和const命令 let用作变量声明,只在代码块内有效 ...