WCF service works on the same box but does not respond in distributed environment

Topics: Interop Bindings, Web Api, WebSockets
Jun 29, 2012 at 6:03 PM
Edited Jun 29, 2012 at 6:07 PM

I have created a WCF Service Library, a windows NT service to host it on my server, and a client application to consume my WCF Service.  With all three running on the same box they work as I would expect but when I try and run the client application on a different machine it just times out without getting an workable error message.  I thought it was a credentials issue so I added the following code to my client application without any success.

Dim proxy = New ShipService.ShipServiceClient() 
proxy.ClientCredentials.Windows.ClientCredential.Domain = "<Domain>" 
proxy.ClientCredentials.Windows.ClientCredential.UserName = "<UserName>" 
proxy.ClientCredentials.Windows.ClientCredential.Password = "<Password>"

I have tried multiple different things like setting SPN, UPN and DNS within the Identity of the endpoint.  I have even tried syncronizing the clock between machines without any success. Also of note:  there are no firewalls between the machines, they are on the same domain,  the logged on user was the same on both machines and has admin rights on both,  the client credentials provided were admin level with full rights to both boxes.  It feels like clientcredentialType=windows is checking some other security to validate the client other than proxy.ClientCredentials.windows.clientcredential.   Can someone shed any light as to why it works great when both client and service are on the same box but times out when they are on different machines?

Here are my WCF Service Library bindings, endpoints, etc.

<bindings>
      <netTcpBinding>
        <binding name="ShipServiceNetTCPEndPoint" 
                 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="65536" 
                 maxConnections="10" 
                 maxReceivedMessageSize="65536">
              <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>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ShipServiceBehavior">
          <serviceAuthorization impersonateCallerForAllOperations="false"/>
          <serviceMetadata httpGetEnabled="false"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="ShipServiceBehavior" name="ServiceLibrary.ShipService">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="" name="ShipServiceNetTCPEndPoint" contract="ServiceLibrary.IShipService">
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="ShipServiceMexTCPEndPoint" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://192.168.1.54:58000/ShipService"/>
          </baseAddresses>
        </host>
      </service>
    </services>

 

Here are my client application bindings and endpoints:

<bindings>
      <netTcpBinding>
        <binding name="ShipServiceNetTCPEndPoint" 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="65536" maxConnections="10"
            maxReceivedMessageSize="65536">
          <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://192.168.1.54:58000/ShipService"
            binding="netTcpBinding" bindingConfiguration="ShipServiceNetTCPEndPoint"
            contract="ShipService.IShipService" name="ShipServiceNetTCPEndPoint">
          <identity>
            <userPrincipalName value="user@domain.net" />
          </identity>
        </endpoint>
      </client>