我有一些自托管服务,需要在客户端使用元数据。当我使用 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>