【发布时间】:2013-02-20 00:50:12
【问题描述】:
我有一些自托管服务,需要在客户端使用元数据。当我使用 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>
【问题讨论】:
-
查看我对以下帖子的回复中的链接,可能会给您一些尝试或排除的东西:stackoverflow.com/questions/14817195/…