ファイアウォールの背後にあるサーバーでスタンドアロンの WCF サービスを実行しています。サービスがコールバックを利用するため、現在使用wsDualHttpBinding
されています。クライアントは LAN 環境で正常に動作します。カスタム ポートでのトラフィックを許可するためにファイアウォールを開いたので、サービスの検出は LAN の外部から機能するようになりました。
この性質上wsDualHttpBinding
、クライアントが独自のファイアウォールの背後にある場合、明らかに機能しません。当然のことながら、netTcpBinding
双方向の問題を解決する必要があることが頭に浮かびます。しかし、奇妙なことは、サービス構成 XML が更新さnetTcpBinding
れて同じポートに含める (および/または除外するwsDualHttpBinding
) と、サービス検出でさえ機能しなくなることです。
私が見逃しているものが他にあるかどうか疑問に思っています。How to: Use netTcpBinding with Windows Authentication and Message Security in WCF Calling from Windows Forms and from Windows Communication Foundation QuickStart - Multiple Binding VS2010の構成に関する正確なアドバイスに従いました。
構成:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBindingEndpointConfig">
<security mode="Message" />
</binding>
</netTcpBinding>
</bindings>
<services>
<service name="Service1.Service1.Service">
<endpoint address="Service1" binding="wsDualHttpBinding" contract="Service1.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint address="" binding="netTcpBinding"
bindingConfiguration="NetTcpBindingEndpointConfig"
name="NetTcpBindingEndpoint" contract="Service1.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:9999/Service1.Service1/"/>
<add baseAddress="net.tcp://localhost:9999/Service1.Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<!-- 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 -->
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>