ServiceHosthost = newServiceHost(typeof(Service), http://localhost:8080/ddd); 只适用于自托管,"http://localhost:8080/ddd"是baseAddress,也可以把地址放到配置文件中: ServiceHost host = new ServiceHost(typeof(Servi... Read More
posted @ 2009-10-23 19:29 包建强 Views(504) Comments(0) Diggs(0) Edit
1.关于宿主(host) 我们一般创建的是以IIS为宿主的,所以我们平常在VS2008中创建的项目,如下图所示,都是IIS托管的。关于IIS托管,上一篇文章已经说得很清楚了。   但是,WCF还有另一种托管方式,称为自托管(Self-Hosting)。 说得深奥些,就是Client和Service共用一个进程。说得通俗些,就是把Client项目和Service项目合二为一,比如说这... Read More
posted @ 2009-10-23 18:13 包建强 Views(413) Comments(1) Diggs(0) Edit
(前言) 我们习惯于使用VS2008中WCF的项目模板,于是Server端的创建基本是不用动脑子的。 又因为我们默认使用的MEX绑定,所以在Client端,我们在VS2008种右击项目,就可以轻松添加Server Reference,这也是不用费脑细胞的。 VS2008让我们把注意力foucus在业务逻辑上,而模糊了WCF的本质。 于是我经常犯糊涂,甚至连WCF最基本的概念有时都混淆。 ... Read More
posted @ 2009-10-23 12:21 包建强 Views(451) Comments(3) Diggs(0) Edit