ファイアウォールの背後にあるサーバーでスタンドアロンWCFサービスを実行しています。サービスがコールバックを利用するため、現在はwsDualHttpBinding
を使用しています。クライアントはLAN環境で正常に動作します。ファイアウォールを開いてカスタムポート上のトラフィックを許可し、サービスの検出が外部LANから機能するようにしました。WCFがファイアウォールの背後にあるwsDualHttpBindingとnetTcpBindingに関連する
wsDualHttpBinding
という性質のため、クライアントが独自のファイアウォールの内側にある場合、これは明らかに機能しません。当然、netTcpBinding
はどちらが双方向の問題を解決するべきかを思い浮かばせます。しかし、奇妙なことは、サービス設定XMLがと同じポート(および/または除外wsDualHttpBinding
)にnetTcpBinding
を含むように更新された場合、サービス検索も機能しなくなることです。
私が紛失しているものが他にもあるかと思います。私はHow to: Use netTcpBinding with Windows Authentication and Message Security in WCF Calling from Windows Formsと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>
サービスの検出とはどういう意味ですか? WCF 4のWS-Discoveryメカニズムを使用していますか? –
いいえ、間違った言葉を使用した可能性があります。 「発見」では、サービス参照の追加が成功したということを意味していました。 – wpfwannabe
サービスの設定全体を表示します。 –