----------------------------Binding绑定:
定义:绑定表示通讯信道的配置;
定义了客户端与服务端之间的协议;
---传输协议:http.tcp.命名管道.msmq,自定义(udp,smtp)
---消息编码:Text.Mtom,Binary,自定义编码;
---标准的绑定:
BasicHttpBinding(兼容soap1.1)\WSHttpBinding(兼容1.2)\NetNamedPipeBinding(进程内或同主机的调用)\NetTcpBinding(同主机或跨主机调用)
\NetPeerTcpBinding(同主机或跨主机调用)\消息绑定: NetMsmqBinding\MsmqIntegrationBinding(用于早期技术的msmsq的交互)
----可以通过配置文件来配置绑定信息;
<system.serviceModel>
<client />
<services>
<service name="">
<endpoint binding="netTcpBinding" bindingConfiguration="netTcp" contract="">
</endpoint>
</service>
</services>
<bindings >
<netTcpBinding>
<binding name="netTcp" maxReceivedMessageSize="5000000">
<security mode="Message">
<message clientCredentialType="Windows"/>
</security>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
------------------------------------宿主:
宿主:self-hosting:控制台或windows,windows服务;
IIs/asp.net;
windows activation Service;
----多服务:创建多个servicehost实例,配置文件的添加多个service节点;
---通过代码实现服务行为的添加
host = new ServiceHost(typeof(wpf));
ServiceDebugBehavior sb = host.Description.Behaviors.Find<ServiceDebugBehavior>();
if (sb == null)
{
sb = new ServiceDebugBehavior();
host.Description.Behaviors.Add(sb);
}
sb.IncludeExceptionDetailInFaults = true;
host.Open();
------------IIS/was宿主;
.svc文件在iis中
相关文章
- wcf和web service的区别
- .net中的三大框架WPF、WCF和EF
- WCF :IIS寄宿方式的Web地址、BaseAddress和EndPoint Address的关系
- WCF的同步和异步(以WPF连接为例)
- 如何在WCF中用TcpTrace工具查看发送和接收的SOAP消息
- 关于WCF的引用,添加服务和添加web服务的区别
- OWIN的理解和实践(二) – Host和Server的开发
- 解决Android SDK Manager更新(一个更新Host的程序的原理实现和源码)
- Webservice WCF WebApi 前端数据可视化 前端数据可视化 C# asp.net PhoneGap html5 C# Where 网站分布式开发简介 EntityFramework Core依赖注入上下文方式不同造成内存泄漏了解一下? SQL Server之深入理解STUFF 你必须知道的EntityFramework 6.x和EntityFramework Cor
- 三十、【C#.Net开发框架】WCFHosting服务主机的利用WCF服务通讯和实现思路