0

1 つの http エンドポイントを持つ WCF サービスを使用しています。別のバインディングを持つ別の http エンドポイント アドレスを追加したいと考えています。このサービスは IIS でホストされていないため、multipleSiteBindingsEnabled を設定しても意味がありません。

このようなことを試みています。

<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

    <services>
            <service behaviorConfiguration="ServiceBehaviorConfiguration"
             name="ServerService">
                <endpoint address="http://localhost:6732/ServerService" binding="webHttpBinding" behaviorConfiguration="webby"
         contract="IClientAppContract">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
                <endpoint address="http://localhost:800/ServerService" binding="basicHttpBinding"
         contract="IClientAppContract">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:800/ServerService" />
                        <add baseAddress="http://localhost:6732/ServerService" />
                    </baseAddresses>
                </host>
            </service>
        </services>
</system.serviceModel>
4

2 に答える 2

0

それぞれ独自の異なる baseAddress を持つ 2 つのサービスを作成できますが、それらの内部エンドポイントは同一です。

于 2012-06-06T22:05:56.027 に答える
0

以下に示す構成のようなものを試してください。単一のポートを介して複数のエンドポイントを公開しますが、この構成パターンは WCF でサポートされていると確信しています。

    <services>
        <service behaviorConfiguration="ServiceBehaviorConfiguration"
                 name="ServerService">
            <endpoint address=""
                      binding="webHttpBinding"
                      behaviorConfiguration="webby"
                      contract="IClientAppContract">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
            <endpoint address="basic"
                      binding="basicHttpBinding"
                      contract="IClientAppContract">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
            <endpoint address="mex"
                      binding="mexHttpBinding"
                      contract="IMetadataExchange" />
            <host>
                <baseAddresses>
                    <add baseAddress="http://localhost:800/ServerService" />
                </baseAddresses>
            </host>
        </service>
    </services>
于 2012-06-05T13:27:34.697 に答える