wcf 给net.tcp 加mex
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="reliableSessionBinding">
<reliableSession enabled="true"/>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="exposeExceptionDetail">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"
httpGetUrl="http://127.0.0.1:9999/filereaderservice/mex" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Artech.WcfServices.Service.CalculatorService"
behaviorConfiguration="exposeExceptionDetail">
<endpoint address="net.tcp://127.0.0.1:3721/calculatorservice"
binding="netTcpBinding"
bindingConfiguration="reliableSessionBinding"
contract="Artech.WcfServices.Service.Interface.ICalculator"/>
</service>
</services>
</system.serviceModel>
</configuration>
using (ServiceHost host = new ServiceHost(typeof(CalculatorService)))
{
host.Open();
Console.WriteLine("OK");
Console.Read();
}
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。