title: Error received when using TCP: "The message could not be dispatched..."
body: <p>I am new to creating WCF services. I have created a WCF web service in VS2008 that is running on IIS 7. When I use http the service works perfectly. When I configure the service for TCP and run I get the following error message.</p>
  
  <blockquote>
    <p>There was a communication problem. The
    message could not be dispatched
    because the service at the endpoint
    address
    'net:tcp://elec:9090/CoordinateIdTool_Tcp/IdToolService.svc
    is unavailable for the protocol of the
    address.</p>
  </blockquote>
  
  <p>I have searched a lot of forums, including this one, for a resolution but nothing has worked. Everything appears to be set up correctly on IIS 7. WAS has been set up to run. The default web site has a net.tcp binding and the application has net.tcp under the enabled protocols.</p>
  
  <p>I am including what I think is the important part of the web.config from the host project and also the app.config from the client project I am using to test the service. Hopefully someone can spot my error. Thanks in advance for any help or recommendations that anyone can provide.</p>
  
  <p><strong>Web.Config</strong></p>
  
  <pre><code>&lt;bindings&gt;
     &lt;wsHttpBinding&gt;
        &lt;binding name="wsHttpBindingNoMsgs"&gt;
           &lt;security mode="None" /&gt;
         &lt;/binding&gt;
     &lt;/wsHttpBinding&gt;
  &lt;/bindings&gt;
  &lt;services&gt;
     &lt;service behaviorConfiguration="CogIDServiceHost.ServiceBehavior"
             name="CogIDServiceLibrary.CogIdService"&gt;
        &lt;endpoint address="" 
                  binding="wsHttpBinding" 
                  bindingConfiguration="wsHttpBindingNoMsgs"
                  contract="CogIDServiceLibrary.CogIdTool"&gt;
           &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
           &lt;/identity&gt;
        &lt;/endpoint&gt;
        &lt;endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
                  contract="IMetadataExchange" /&gt;
        &lt;endpoint name="CoordinateIdService_TCP"
            address="net.tcp://elec:9090/CoordinateIdTool_Tcp/IdToolService.svc"
            binding="netTcpBinding" bindingConfiguration="" 
            contract="CogIDServiceLibrary.CogIdTool"&gt;
           &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
           &lt;/identity&gt;
        &lt;/endpoint&gt;
      &lt;/service&gt;
   &lt;/services&gt;
   &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
         &lt;behavior name="CogIDServiceHost.ServiceBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
         &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
   &lt;/behaviors&gt;
  </code></pre>
  
  <p><strong>App.Config</strong></p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;diagnostics performanceCounters="Off"&gt;
          &lt;messageLogging logEntireMessage="true" logMalformedMessages="false"
              logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="false" /&gt;
      &lt;/diagnostics&gt;
      &lt;behaviors /&gt;
      &lt;bindings&gt;
          &lt;wsHttpBinding&gt;
              &lt;binding name="WSHttpBinding_CogIdTool" closeTimeout="00:01:00"
                  openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                  bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                  maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                  messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                  allowCookies="false"&gt;
                  &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                      maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
                  &lt;reliableSession ordered="true" inactivityTimeout="00:10:00"
                      enabled="false" /&gt;
                  &lt;security mode="None"&gt;
                      &lt;transport clientCredentialType="Windows" proxyCredentialType="None"
                          realm="" /&gt;
                      &lt;message clientCredentialType="Windows" negotiateServiceCredential="true"
                          establishSecurityContext="true" /&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
              &lt;binding name="wsHttpBindingNoMsg"&gt;
                  &lt;security mode="None"&gt;
                      &lt;transport clientCredentialType="Windows" /&gt;
                      &lt;message clientCredentialType="Windows" /&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
          &lt;endpoint address="http://sdet/CogId_WCF/IdToolService.svc" binding="wsHttpBinding"
              bindingConfiguration="wsHttpBindingNoMsg" contract="CogIdServiceReference.CogIdTool"
              name="IISHostWsHttpBinding"&gt;
              &lt;identity&gt;
                  &lt;dns value="localhost" /&gt;
              &lt;/identity&gt;
          &lt;/endpoint&gt;
          &lt;endpoint address="http://localhost:1890/IdToolService.svc" binding="wsHttpBinding"
              bindingConfiguration="WSHttpBinding_CogIdTool" contract="CogIdServiceReference.CogIdTool"
              name="WSHttpBinding_CogIdTool"&gt;
              &lt;identity&gt;
                  &lt;dns value="localhost" /&gt;
              &lt;/identity&gt;
          &lt;/endpoint&gt;
          &lt;endpoint address="http://elec/CoordinateIdTool/IdToolService.svc"
              binding="wsHttpBinding" bindingConfiguration="wsHttpBindingNoMsg"
              contract="CogIdServiceReference.CogIdTool" name="IIS7HostWsHttpBinding_Elec"&gt;
              &lt;identity&gt;
                  &lt;dns value="localhost" /&gt;
              &lt;/identity&gt;
          &lt;/endpoint&gt;
        &lt;endpoint address="net.tcp://elec:9090/CoordinateIdTool_Tcp/IdToolService.svc"
            binding="netTcpBinding" bindingConfiguration="" contract="CogIdServiceReference.CogIdTool"
              name="IIS7HostTcpBinding_Elec" &gt;
          &lt;identity&gt;
            &lt;dns value="localhost"/&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>