c# - WCF 试图公开一个 nettcp 端点; TCP 错误代码 10061 : No connection could be made because the target machine actively refused it

标签 c# .net wcf

我不明白这里的问题是什么。我的 wsHttpBinding 工作正常。这是我的配置。非常感谢任何帮助。

<?xml version="1.0"?>
<configuration>
  .....
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="DataService.Service1Behavior"
               name="ODHdotNET.DataService">
        <endpoint 
               address="" 
               binding="wsHttpBinding" 
               bindingConfiguration="largeTransferwsHttpBinding"
               contract="ODHdotNET.IDataService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint 
            address="net.tcp://139.149.141.221:8001/DataService.svc" 
            binding="netTcpBinding" 
            contract="ODHdotNET.IDataService"/>
        <endpoint 
            address="mex" 
            binding="mexHttpBinding" 
            contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://139.149.141.221:8000/DataService.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="largeTransferwsHttpBinding2" 
                 maxReceivedMessageSize="5000000" maxBufferPoolSize="5000000">
          <security mode ="Message">
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
        <binding name="largeTransferwsHttpBinding" 
                 maxReceivedMessageSize="5000000" maxBufferPoolSize="5000000" />
      </wsHttpBinding>
     </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="DataService.Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

编辑:我在 Windows 服务中自托管;我没有使用 IIS。

最佳答案

您是说 WCF 客户端会抛出此错误吗? 如果是这样: 请在命令提示符下运行以下命令: 网络统计-ona |找到“8001” 如果返回数据,请发布

关于c# - WCF 试图公开一个 nettcp 端点; TCP 错误代码 10061 : No connection could be made because the target machine actively refused it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5016857/

相关文章:

.net - 在运行时动态选择表名的最佳方法是什么?

.net - Python 中 .Net InvalidOperationException 的类比是什么?

multithreading - WCF Operation.Context 不是线程安全的?

c# - ODBC 公共(public)语言引用?

c# - 使用C#获取两个字母(AE)之间的字母(ABCDE)

C# 字典找不到字符串键

c# - .net XMS 中的 IBM-MQ 阅读器用于逐一确认已处理的消息

wcf - WCF 是否支持 SNI(服务器名称指示)

c# - 使用 WinForm 或应用程序在客户端上打印

c# - 连接 C# 和 Oracle 数据库