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

在开发环境中如何配置netTcp 绑定

2011-01-31 10:29 447 查看
可以参考/article/4589559.html

baseAddress 要设置成 http. 这样可以在添加服务引用中,自动配置.

http://localhost:8731 的端口和 net.tcp://localhost:54321 的端口不能相同

<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="wcfWinServer.AddServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="wcfWinServer.AddServiceBehavior"
name="wcfWinServer.AddService">
<endpoint address="net.tcp://localhost:54321/Binding/Hello" binding="netTcpBinding" contract="wcfWinServer.IAddService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8731/Design_Time_Addresses/wcfWinServer/AddService/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: