[WCF实践]1.WCF使用net.tcp寄宿到IIS中
一、IIS部分
-
<%@ServiceHostLanguage="C#"Debug="true"Service="Web.API.Implementations.DesignCaseService"%>
<system.serviceModel> <services> <service name="Web.API.Implementations.DesignCaseService" > <endpoint binding="netTcpBinding" address="" contract="Web.API.Interfaces.IDesignCaseService" /> <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/> <host> <baseAddresses> <add baseAddress="net.tcp://localhost/DesignCaseService"/> </baseAddresses> </host> </service> </services> <bindings> <netTcpBinding> <binding portSharingEnabled="true"></binding> </netTcpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior> <!-- 非常重要 --> <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false --> <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/> <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。