您的位置:首页 > 理论基础 > 计算机网络

一个完整的Net Tcp WCF配置文件

2016-05-16 12:54 585 查看
一个完整的Net Tcp WCF配置文件全文如下,按照此配置就能正常运行:

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceMetadata httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="netTcpBindingConfiguration">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647 " maxArrayLength="2147483647 " maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service name="Services.MyService" behaviorConfiguration="metadataBehavior">
<endpoint address="MyService"  binding="netTcpBinding" contract="Contracts.IService" bindingConfiguration="netTcpBindingConfiguration"  />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9999/"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: