在开发环境中如何配置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>
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>
相关文章推荐
- [使用 Weex 和 Vue 开发原生应用] 1 如何配置开发环境
- 如何在VC中配置winPcap开发环境
- 如何搭建Eclipse +Apache Tomcat配置Java开发环境
- 如何在Eclipse中配置python开发环境
- 如何配置Eclipse+Tomcat 开发环境【转】
- 如何搭建配置php开发环境
- 如何让一部全新的 MacBook 快速完成开发环境配置
- 在VS2013下如何配置DirectX SDK的开发环境_百度经验
- 如何配置DirectX开发环境
- qtcreator开发环境中如何配置交叉编译环境
- 如何搭建Java开发环境(包括下载、安装和配置JDK)和Eclipse的安装
- NDK开发,如何配置 debug环境
- Maven_如何为开发和生产环境建立不同的配置文件 --我的简洁方案
- WP8开发环境配置 以及 如何知道自己的CPU支持SLAT
- Quick-3.3绑定自定义C++类(一)配置lua运行及开发环境
- 如何在Linux下配置Java开发环境详述
- 在windows下如何配置RTT开发环境?
- 如何搭建Eclipse +Apache Tomcat配置Java开发环境
- AndroidStudio如何配置NDK/JNI开发环境
- 如何在Windows上配置EBS R12.1.3的OAF开发环境