1

我有一些自托管服务,需要在客户端使用元数据。当我使用 WcfTestClient 打开服务时,它会失败并显示消息“错误:无法从https://localhost:8000/”获取元数据我应该修复什么?

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="PrinterServiceBehavior">
                <serviceMetadata httpGetEnabled="false" httpsGetEnabled="True"/>
                <serviceDebug includeExceptionDetailInFaults="False" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <wsHttpBinding>
            <binding name="TransportSecurity">
                <security mode="Transport">
                    <transport clientCredentialType="Basic"/>
                </security>
            </binding>
            <binding name="NoSecurity">
                <security mode="None" />
            </binding>
        </wsHttpBinding>
    </bindings>
    <services>
        <service behaviorConfiguration="PrinterServiceBehavior" name="App.PrinterService">
            <host>
                <baseAddresses>
                    <add baseAddress="https://localhost:8000/" />
                </baseAddresses>
            </host>
            <endpoint address="printer" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="App.IPrinterService" />
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>
    </services>
</system.serviceModel>
4

1 回答 1

0

您是否已使用 HTTP.SYS 配置 SSL 证书以使 SSL 与自主机工作?是一篇很好的博客文章,解释了如何使用 selfhost 配置 SSL。

于 2013-02-19T16:50:12.427 回答