用代码编写WCF配置文件

string BaseString="http://localhost:8000/webcast/";
//假如使用BasicHttpBinding的情况,其他情况可以修改
BasicHttpBinding binding1=new BasicHttpBinding();
binding1.ClaseTimeout=new TimeSpan(0,2,0);

using (ServieceHost host=new ServiceHost(typeof(服务方法的类库名称)))
{
    host.AddServiceEndpoint(typeof(服务接口类库名称),binding1,BaseString)
    host.Open();
}
posted @ 2012-04-28 11:06  王宏磊@中国  阅读(279)  评论(0编辑  收藏  举报