title: WCF issues with wsDualHttpBinding and netTcpBinding behind firewalls
body: <p>I have a standalone WCF service running on a server behind a firewall. It currently uses <code>wsDualHttpBinding</code> as the service utilizes callbacks. The client works fine in a LAN environment. We have opened the firewall to allow traffic on a custom port and so the discovery of the service now works from outside LAN.</p>
  
  <p>Due to the nature of <code>wsDualHttpBinding</code> this obviously cannot work if the client is behind a firewall of its own. So naturally, <code>netTcpBinding</code> comes to mind which should solve the bidirectional problem. But the strange thing is that when service configuration XML is updated to include <code>netTcpBinding</code> on the <strong>same</strong> port (and/or exclude <code>wsDualHttpBinding</code>), then even the service discovery no longer works.</p>
  
  <p>I am wondering if there is anything else that I am missing. I have followed the exact advice for configuration from <a href="http://msdn.microsoft.com/en-us/library/ff648534.aspx" rel="nofollow">How to: Use netTcpBinding with Windows Authentication and Message Security in WCF Calling from Windows Forms</a> and from <a href="http://www.codeproject.com/Articles/89312/Windows-Communication-Foundation-QuickStart-Multip" rel="nofollow">Windows Communication Foundation QuickStart - Multiple Binding VS2010</a>.</p>
  
  <p>The configuration:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;bindings&gt;
      &lt;netTcpBinding&gt;
        &lt;binding name="NetTcpBindingEndpointConfig"&gt;
          &lt;security mode="Message" /&gt;
        &lt;/binding&gt;
      &lt;/netTcpBinding&gt;
    &lt;/bindings&gt;
    &lt;services&gt;
      &lt;service name="Service1.Service1.Service"&gt;
        &lt;endpoint address="Service1" binding="wsDualHttpBinding" contract="Service1.IService1"&gt;
          &lt;identity&gt;
            &lt;dns value="localhost"/&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
        &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
        &lt;endpoint address="" binding="netTcpBinding"
                   bindingConfiguration="NetTcpBindingEndpointConfig"
                   name="NetTcpBindingEndpoint" contract="Service1.IService1"&gt;
          &lt;identity&gt;
            &lt;dns value="localhost" /&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
        &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress="http://localhost:9999/Service1.Service1/"/&gt;
            &lt;add baseAddress="net.tcp://localhost:9999/Service1.Service1/" /&gt;
          &lt;/baseAddresses&gt;
        &lt;/host&gt;
      &lt;/service&gt;
    &lt;/services&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior&gt;
          &lt;!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment --&gt;
          &lt;serviceMetadata httpGetEnabled="True"/&gt;
          &lt;!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information --&gt;
          &lt;serviceDebug includeExceptionDetailInFaults="True"/&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>