1. 程式人生 > >WCF

WCF

del rac bin add int mod tin self 定義

1、 WCF是SOA(面向服務的框架)的開發模板

2、WCF的服務不能孤立的存在,必須寄宿於一個運行著的進程(稱為宿主),為服務指定給宿主的過程稱為服務寄宿(Service Hosting)。常用的寄宿方式:自我寄宿(Self-Hosting)和IIS寄宿。VS中的WCF模板項目,就是用的IIS寄宿。

3、創建Self-Hosting程序,要引用 System.ServiceModel.dll 。

創建服務契約接口:IService.cs 應用 System.ServiceModel.ServiceContractAtribute特性,定義成服務契約

創建服務:Service.cs ,繼承IService.cs接口

服務寄宿:使用終結點(Endpoint),在進程中寄宿。終結點由:地址(Address)、綁定(Binding)、契約(Contact)組成。

WCF