我有一个具有一个 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>