配置WCF服务(Web.config) - HttpsGetEnabled,HttpsGetUrl [英] Configuring a WCF service (Web.config) - HttpsGetEnabled, HttpsGetUrl

查看:1095
本文介绍了配置WCF服务(Web.config) - HttpsGetEnabled,HttpsGetUrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将带有WCF服务的Silverlight部署到托管服务器。基本上,我和这个人有同样的问题:
如何配置WCF服务以在没有HTTP绑定的情况下通过HTTPS工作?
除了解决方案对我不起作用。

I am trying to deploy a Silverlight with WCF Service to a hosting. Basically, I have the same problem as this guy: How to configure WCF services to work through HTTPS without HTTP binding? Except the solutions don't work for me.

//编辑:我一直贴错了,但它仍然不起作用。

//edit: I've been pasting it wrong, but it still doesn't work.

我试过Ladislav Mrnka的答案 - 在网上改了这个.config文件:

I have tried Ladislav Mrnka's answer - changed this in the Web.config file:

  <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />

当我导航到服务器上的.svc文件时,仍然会出现可怕的错误:

The dreaded error still appears when I navigate to the .svc file on the server:

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
吗?在哪里?

Now it should be all correct, I just changed the httpGetEnabled and httpsGetEnabled in the proper place (it's already in the config file). But I still get the error. Should I perhaps specify the HttpsGetUrl somewhere? Where?

是的,请参阅这里

应该是:

<behaviors>
 <serviceBehaviors>
  <behavior name="NewBehavior">
    <serviceMetadata httpsGetEnabled="true" 
     httpsGetUrl="https://myComputerName/myEndpoint" />
  </behavior>
 </serviceBehaviors>
</behaviors>

这篇关于配置WCF服务(Web.config) - HttpsGetEnabled,HttpsGetUrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆