WCF 基于 WinForm 宿主 发布
来源:互联网 发布:数据帧格式设计 编辑:程序博客网 时间:2024/06/05 00:32
BasicHttpBinding
ServiceHost Host = new ServiceHost(typeof(ServiceHTTP)); //绑定 System.ServiceModel.Channels.Binding httpBinding = new BasicHttpBinding(); //终结点 Host.AddServiceEndpoint(typeof(IServiceHTTP), httpBinding, "http://localhost:8732/WcfHTTPService"); if (Host.Description.Behaviors.Find<System.ServiceModel.Description.ServiceMetadataBehavior>() == null) { //行为 ServiceMetadataBehavior behavior = new ServiceMetadataBehavior(); behavior.HttpGetEnabled = true; //元数据地址 behavior.HttpGetUrl = new Uri("http://localhost:8732/WcfHTTPService"); Host.Description.Behaviors.Add(behavior); //启动 if (Host.State != CommunicationState.Opened) { Host.Open(); } }
NetTcpBinding
ServiceHost Host = new ServiceHost(typeof(ServiceTCP)); //绑定 System.ServiceModel.Channels.Binding netTcp = new NetTcpBinding(); //终结点 Host.AddServiceEndpoint(typeof(IServiceTCP), netTcp, "net.tcp://192.168.1.88:54321/TCPService"); if (Host.Description.Behaviors.Find<System.ServiceModel.Description.ServiceMetadataBehavior>() == null) { //行为 ServiceMetadataBehavior behavior = new ServiceMetadataBehavior(); behavior.HttpGetEnabled = true; //元数据地址 behavior.HttpGetUrl = new Uri("http://localhost:8730/WcfTCPService"); Host.Description.Behaviors.Add(behavior); //启动 if (Host.State != CommunicationState.Opened) { Host.Open(); } }
NetNamedPipeBinding
ServiceHost Host = new ServiceHost(typeof(ServiceIPC)); //绑定 System.ServiceModel.Channels.Binding httpBinding = new NetNamedPipeBinding(); //终结点 Host.AddServiceEndpoint(typeof(IServiceIPC), httpBinding, "net.pipe://localhost/IPCService"); if (Host.Description.Behaviors.Find<System.ServiceModel.Description.ServiceMetadataBehavior>() == null) { //行为 ServiceMetadataBehavior behavior = new ServiceMetadataBehavior(); behavior.HttpGetEnabled = true; //元数据地址 behavior.HttpGetUrl = new Uri("http://localhost:8006/WcfIPCService"); Host.Description.Behaviors.Add(behavior); //启动 if (Host.State != CommunicationState.Opened) { Host.Open(); } }
- WCF 基于 WinForm 宿主 发布
- WCF——1.3 WCF服务、WinForm宿主、WinForm客户端
- WCF基本概念&以winfrom为宿主发布WCF
- 使用Winform程序作为WCF服务的宿主
- 使用Winform程序作为WCF服务的宿主
- WCF宿主
- WCF中采用控制台宿主和Winform宿主的主要区别
- 利用IIS作为宿主 发布你的WCF Service
- 利用IIS作为宿主 发布你的WCF Service
- 【菜鸟学WCF】以Winform为宿主的wcf简单教程
- 强大的WCF宿主
- WCF 宿主问题
- WCF服务自宿主
- WCF创建宿主程序
- 使用IIS作为宿主发布WCF服务常见错误以及解决方法
- WCF的宿主 - -WCF的配置文件
- WCF入门教程三[WCF的宿主]
- WCF入门教程三[WCF的宿主]
- yuv转opencv中的IplImage
- 内部排序算法的比较和实现
- openCV在vs2005中配置
- Java容器集合类的区别用法
- c# ms chart 控件使用方法
- WCF 基于 WinForm 宿主 发布
- 厦大计算机研究生
- Ajax发请求的基本流程
- centos mysql
- 同步/异步与阻塞/非阻塞简介
- as3 和PHP 后台交互
- 黑马程序员——Java异常处理学习笔记
- 初学Java,jar命令详解(二十四)
- 冒泡排序(java,c#)