2013-02-19 64 views
1

我有一些自託管服務,需要在客戶端使用元數據。當我使用WcfTestClient打開服務時,它失敗,顯示「錯誤:無法從https://localhost:8000/獲取元數據」 我應該修復哪些問題?無法從WCF自託管服務讀取元數據

<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> 
+0

查看我對以下帖子的回覆中的鏈接,可能會給你一些東西嘗試或排除:http://stackoverflow.com/questions/14817195/wcf-test-client-and-authentication/14834041#14834041 – Tanner 2013-02-19 16:37:05

回答

1

您是否配置了HTTP.SYS您的SSL證書來獲得具有自主工作SSL? Here是一篇很好的博客文章,解釋瞭如何使用selfhost配置SSL。

+0

非常感謝! – 2013-02-19 16:52:55