没有端点侦听net.tcp:// localhost:10001可以接受该消息

时间:2015-04-01 13:47:12

标签: wcf windows-server-2008 windows-server-2003

将WCF服务从Windows 2003 Server移动到Windows 2008 Server时出现问题。此服务在同一服务器上的网站和Windows服务之间进行通信。该服务在2003 Server和本地Windows 7计算机上使用以下配置运行。

在2008服务器上,我收到以下错误消息

异常类型:System.ServiceModel.EndpointNotFoundException

消息: net.tcp:// localhost:10001 / DCFDirectCert / SecurityService上没有可以接受该消息的端点。这通常是由不正确的地址或SOAP操作引起的。

网站配置

  <system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true"
                      logMessagesAtTransportLevel="true" />
    </diagnostics>
    <bindings>
      <netTcpBinding>
        <binding name="DirectCertBindingConfig">
          <security mode="None" />
        </binding>
        <binding name="DirectCert.Services.DirectCertSecurityService.BindingConfig" closeTimeout="00:01:00"
                 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
                 transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard"
                 listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="1000000" maxConnections="10"
                 maxReceivedMessageSize="1000000">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096"
                        maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint address="net.tcp://localhost:10001/DirectCert/SecurityService" binding="netTcpBinding"
                bindingConfiguration="DirectCert.Services.DirectCertSecurityService.BindingConfig"
                contract="IDirectCertSecurityService" name="IDirectCertSecurityService" />
    </client>
  </system.serviceModel>

Windows服务配置

 <system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true"
                      logMessagesAtTransportLevel="true" />
    </diagnostics>
    <bindings>
      <netTcpBinding>
        <binding name="DirectCert.Services.DirectCertSecurityService.BindingConfig">
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="DirectCert.Services.DirectCertSecurityService.Behavior"
               name="DirectCertSecurityService">
        <endpoint address="" binding="netTcpBinding"
                  bindingConfiguration="DirectCert.Services.DirectCertSecurityService.BindingConfig"
                  contract="IDirectCertSecurityService" />
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:10001/DirectCert/SecurityService" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <client>
      <endpoint address="net.msmq://localhost/private/DirectCert" binding="netMsmqBinding"
                bindingConfiguration="DirectCert.Services.DirectCertMatchService.BindingConfig"
                contract="IDirectCertMatchService" name="DirectCertMatchServiceClient" />
    </client>
    <behaviors>
      <serviceBehaviors>
        <behavior name="myBehaviorConfiguration">
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="DirectCert.Services.DirectCertSecurityService.Behavior">
          <serviceMetadata />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer />
          <serviceTimeouts />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

1 个答案:

答案 0 :(得分:1)

我可以看到,两个绑定的安全模式不一样(传输与无)。