App.config
binding 三种类型
basicHttpBinding 使用http协议适合简单跨平台
netTcpBinding tcp多台机器通信,速度快不好跨平台
netMsmqBinding 基于msmq消息队列的wcf服务
address=“mex”
如果wcf服务地址不加/结尾那么会这个mex作为后缀
/Wcf_Console_Server/StudentService/mex
<system.serviceModel>
<bindings>
<basicHttpBinding>
<!--open打开连接超时时间, send客户端请求超时时间30秒 默认一秒-->
<binding name="myBasicHttpBinding" openTimeout="00:30:00" sendTimeout="00:30:00"></binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<!--发布service到iis的时候可以把这个元数据设置为false-->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!--给客户端抛出异常,调试可以打开-->
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Wcf_Console_Server.StudentService">
<!--address WCF服务的地址,如果address为空则使用下面的baseAddress地址-->
<!--binding 客户端和服务端通信的通道类型-->
<!--contract 具体的约定接口-->
<endpoint bindingConfiguration="myBasicHttpBinding" address="" binding="basicHttpBinding" contract="Wcf_Console_Server.IStudentService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/Wcf_Console_Server/StudentService/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>