----------------------------Binding綁定:
定義:綁定表示通訊信道的配置;
定義了客戶端與服務(wù)端之間的協(xié)議;
---傳輸協(xié)議:http.tcp.命名管道.msmq,自定義(udp,smtp)
---消息編碼:Text.Mtom,Binary,自定義編碼;
---標(biāo)準(zhǔn)的綁定:
BasicHttpBinding(兼容soap1.1)\WSHttpBinding(兼容1.2)\NetNamedPipeBinding(進(jìn)程內(nèi)或同主機(jī)的調(diào)用)\NetTcpBinding(同主機(jī)或跨主機(jī)調(diào)用)
\NetPeerTcpBinding(同主機(jī)或跨主機(jī)調(diào)用)\消息綁定: NetMsmqBinding\MsmqIntegrationBinding(用于早期技術(shù)的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服務(wù);
IIs/asp.net;
windows activation Service;
----多服務(wù):創(chuàng)建多個servicehost實(shí)例,配置文件的添加多個service節(jié)點(diǎn);
---通過代碼實(shí)現(xiàn)服務(wù)行為的添加
?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中
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
