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 ...
随机推荐
- java中关于时间的格式化
long time = System.currentTimeMillis(); SimpleDateFormat format = new SimpleDateFormat(); String s = ...
- poj1182 食物链(种类并查集)详解
poj 1182 http://poj.org/problem?id=1182 分析:这个题大意说的非常清楚了,就是求出假话的个数,题目中给的假话要求有三个 ① 当前的话与前面的某些真的话冲突,是 ...
- MVC小系列(五)【在过滤器里引入重定向】
在过滤器里引入重定向 过滤器的引入:如果用户进行一个操作,但没有登录,可以在Post方法上加个过滤器以验证用户是否登录,如果登录成功,则继续进行操作,如果没有登录,则实现Url的重定向,进行登录页 授 ...
- java将Excel文件(xlsx,xls)转换为csv文件
http://blog.csdn.net/bryan__/article/details/40715309
- Codevs 1814 最长链
1814 最长链 时间限制: 1 s 空间限制: 256000 KB 题目等级 : 钻石 Diamond 题目描述 Description 现给出一棵N个结点二叉树,问这棵二叉树中最长链的长度为多少, ...
- 九度OJ 1371 最小的K个数 -- 堆排序
题目地址:http://ac.jobdu.com/problem.php?pid=1371 题目描述: 输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4 ...
- 九度OJ 1455 珍惜现在,感恩生活 -- 动态规划(背包问题)
题目地址:http://ac.jobdu.com/problem.php?pid=1455 题目描述: 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元, ...
- get share button count
class shareCount { private $url,$timeout; function __construct($url,$timeout=10) { $this->url=raw ...
- 内容写到 csv 格式的文件中 及 读取 csv 格式的文件内容
<?php/*把内容写到 csv 格式的文件中 基本思路是:1.用 $fp = fopen("filename", 'mode')打开一个csv文件,可以是打开时才建立的2. ...
- PHP数组操作——获取数组最后一个值的方法
php开发过程中,可能经常需要对取出的数组要获取数组的最后健或值.在这里总结了三个方法,并且跟据他们三个方法在一些情况下如何使用的条件限制进行了说明. <?php $array=array(1, ...