对于WCF框架解释说明

开发 后端
WCF框架作为一个高效的.NET程序语言。其混合了函数语言和物件导向程序编制语言,并且完美的适用于编程、算法、技术和探索性开发,因此可以在使用的过程当中感受到趣味性和吸引力。

WCF框架为终结点定义了一个专门的ServiceEndpoint类,被定义在System.ServiceModel.Description命名空间中。ServiceEndpoint类包含了EndpointAddress,Binding,ContractDescription三个类型的属性,分别对应Endpoint的Address,Binding,Contract,如下图:

Endpoint的Address

要获取服务的终结点,可以通过抽象类MetadataImporter获取,类的定义如下:

  1.  public abstract class MetadataImporter  
  2. {  
  3. public abstract Collection<ContractDescription> ImportAllContracts();  
  4. public abstract ServiceEndpointCollection ImportAllEndpoints();  
  5. 其它方法略;  
  6. }  

WCF框架中,最重要的一个方法是ImportAllEndpoints(),WCF框架能够获取服务的所有终结点,并返回一个ServiceEndpointCollection类型的对象。该WCF框架为一个终结点集合,可以通过调用ServiceEndpointCollection的Find()方法或FindAll()方法,找到符合条件的一个或多个终结点。它的定义如下:

  1. public class ServiceEndpointCollection : Collection<ServiceEndpoint> 
  2. {  
  3. public ServiceEndpoint Find(Type contractType);  
  4. public ServiceEndpoint Find(Uri address);  
  5. public Collection<ServiceEndpoint> FindAll(Type contractType);  
  6. 其它成员略  
  7. }  
责任编辑:chenqingxiang 来源: 百度博客
相关推荐

2009-12-08 09:33:53

WCF服务

2009-12-07 18:26:36

WCF客户端

2009-12-14 09:09:35

VS 2008 Pro

2009-12-07 16:57:39

WCF安全性

2009-12-07 18:06:46

WCF框架

2009-12-09 17:20:13

2009-12-08 16:15:13

WCF服务

2009-12-04 17:47:04

WCF 服务

2009-12-14 10:19:23

.NET Framew

2009-11-24 13:23:11

Visual Stud

2009-12-04 17:56:18

WCF 服务测试

2010-01-08 10:34:49

JavaScript解

2009-12-01 18:07:12

VS 2003工具

2009-12-03 15:32:05

Visual Stud

2010-01-05 15:40:10

JQuery框架

2009-12-07 09:58:35

WCF性能

2009-12-08 11:08:27

WCF双向

2009-12-07 16:48:33

WCF 安全性

2009-12-17 14:59:43

VS 9.0版本

2009-12-08 10:21:17

WCF地址
点赞
收藏

51CTO技术栈公众号