以下に指定されている構成ファイルを持つWCFサービスがあります。
<system.serviceModel>
<services>
<service name="WCFService.ServiceClass" behaviorConfiguration="metaDataSupport">
<host>
<baseAddresses>
<add baseAddress="net.pipe://localhost/WCFService"/>
<add baseAddress="net.tcp://localhost:8100/WCFService"/>
<add baseAddress="http://localhost:8101/WCFService"/>
</baseAddresses>
</host>
<endpoint address="tcpmex"
binding="mexTcpBinding"
contract="IMetadataExchange" />
<endpoint address="namedpipemex"
binding="mexNamedPipeBinding"
contract="IMetadataExchange" />
<endpoint address=""
binding="wsHttpBinding"
contract="WCFService.IServiceClass" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metaDataSupport">
<serviceMetadata httpGetEnabled="false" httpGetUrl="" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
ここには、NamedPipeBinding、TcpBinding、wsHttpBindingの3種類のバインディングがあります。
次の場所にメタデータを含む参照を追加できます
net.tcp:// localhost:8100 / WCFService / tcpmex
net.pipe:// localhost / WCFService / namedpipemex
動作中のサービスのhttpGetを無効にしました。
サービス参照が追加されますが、クライアントで次の構成が使用されます。
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSHttpBinding_IServiceClass" />
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8101/WCFService" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IServiceClass" contract="TCP.IServiceClass"
name="WSHttpBinding_IServiceClass">
</endpoint>
</client>
</system.serviceModel>
しかし、TCPバインディングエンドポイントを使用して参照を追加したので、次のことを期待していました。
address = net.tcp:// localhost:8100 / WCFService
およびbinding="mexTcpBinding"
サービスは機能していますが、ここで何が起こっているのか知りたいです。これの理由は何ですか。baseAddressが原因ですか、それともwsHttpBindingが優先されますか?
考えは大歓迎です。
ありがとう。