Search code examples
wcfc#-4.0wcf-bindingwcf-security

WCF server rejects connections from localhost


I have a WCF service running on a net.tcp port inside a hosting application running on my computer - Windows 2003 64 bit.

The application will accept connections from a colleague's machine and locally from the WCF Test Client and sends back the appropriate information. I can also use my client to connect to the service running on my colleague's machine.

Unfortunately it won't allow me to connect to the service from the client running on my machine. Client on my colleague's machine with server on colleague's machine also fails.

Confusingly, the app also runs another service which works fine locally and remotely.

This works:  net.tcp://localhost:8736/EchoExcelServices/
This doesnt: net.tcp://localhost:8736/EchoExcelServices/Uploader

The exception given in the client app is a SecurityNegotiatanException with the message

The server has rejected the client credentials

Inside it (a couple of layers down) is a Win32Exception with the message

The logon attempt failed

EDIT: The behaviours section is as follows:

 <behaviors>
      <serviceBehaviors>
        <behavior name="EchoExcelLibrary.MetadataBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
          <behavior name="ImpersonationBehavior">
          <clientCredentials>
            <windows allowedImpersonationLevel="Impersonation"/>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>

EDIT 2 altered behaviours secion:

  <endpointBehaviors>
    <behavior name="ImpersonationBehavior">
    </behavior>
  </endpointBehaviors>

Solution

  • This was a problem with the setup of DTC on our machines. It is now resolved