我试图设置一个使用net.tcp绑定进行测试的服务。我还设置了一个http端点。配置如下:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="Inbound_REST">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="InboundHttpConfiguration">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="InboundTcpConfiguration">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="InboundTcpConfiguration" name="Inbound">
<endpoint address="" binding="netTcpBinding" contract="IContract">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:6969/Inbound" />
</baseAddresses>
</host>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<client>
<endpoint name="httpEndPoint" address="http://localhost:1568/Inbound.svc" binding="basicHttpBinding" contract="IContract" />
<endpoint name="tcpEndPoint" address="net.tcp://localhost:6969/Inbound" binding="netTcpBinding" contract="IContract" />
</client>
<bindings>
<basicHttpBinding>
<binding name="httpbind">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="tcpbind">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>当我试图使用net.tcp绑定使用服务时,它总是返回错误:
无法连接到net.tcp://localhost:6969/入站。连接尝试持续时间为00:00:00.9531494。TCP错误代码10061:无法连接,因为目标机器主动拒绝它127.0.0.1:6969。
顺便说一句,http绑定工作正常。我认为这可能是一些机器配置,但无法找到什么是根本原因。
发布于 2011-11-10 21:12:30
如果您试图通过visual studio运行WCF服务,则不支持netTcpBinding。抱歉的!
发布于 2011-11-10 13:07:46
为什么您省略了客户端net.tcp地址的“net.tcp”?也许应该是“net.tcp://localhost:6969/In量.6969”
发布于 2011-11-10 13:32:50
什么托管您是using..IIS7或控制台或其他?
1)检查所有tcp服务是否运行在services.msc中。
2)关闭防火墙或向tcp端口添加防火墙异常
如果您正在iis7中托管,请检查此链接
IIS7对非http协议的支持
https://stackoverflow.com/questions/8079090
复制相似问题