我正在尝试将带有WCF服务的Silverlight部署到托管服务器。基本上,我和这个家伙有同样的问题:
如何配置WCF服务以在没有HTTP绑定的情况下通过HTTPS工作?
除了解决方案不适合我。
//编辑:我一直错误地粘贴它,但它仍然无效。
我试过Ladislav Mrnka的答案 - 在Web.config文件中更改了这个:
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
当我导航到服务器上的.svc文件时,仍会出现可怕的错误:
The HttpsGetEnabled property of ServiceMetadataBehavior is set to true and the
HttpsGetUrl property is a relative address, but there is no https base address.
Either supply an https base address or set HttpsGetUrl to an absolute address.
现在它应该是正确的,我只是改变了httpGetEnabled和
httpsGetEnabled在适当的位置(它已经在配置文件中)。
但我仍然得到错误。我应该指定HttpsGetUrl
某处?哪里?
是的,看 这里。
应该:
<behaviors>
<serviceBehaviors>
<behavior name="NewBehavior">
<serviceMetadata httpsGetEnabled="true"
httpsGetUrl="https://myComputerName/myEndpoint" />
</behavior>
</serviceBehaviors>
</behaviors>
在配置中,在您设置httpsGetEnabled =“true”的行为下,
同时设置httpsGetUrl =“https:// UserSystemName / EndPointName”并解决问题。
<behaviors>
<serviceBehaviors>
<behavior name="mexBehaviour">
<serviceMetadata httpsGetEnabled="true" httpsGetUrl="https:///UserSystemName/EndPointName"/>
</behavior>
</serviceBehaviors>
</behaviors>