服务.svc无法在https上运行 [英] services .svc not working on https
问题描述
我有一个同时使用http和https的网站
但是mywebsite.com/xyz.svc仅适用于http,不适用于https.
尝试解决的方法:
在下面添加了绑定:
I got a website working on http and https both
but mywebsite.com/xyz.svc only works with http not with https.
solution tried:
added binding below:
<basicHttpBinding>
<binding name="sslBinding">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
在服务端点中引用了此绑定:
referred this binding in service endpoint:
<service name="BroadcastMonitor" behaviorConfiguration="BroadcastMonitorBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="sslBinding" contract="mView.IBroadcastMonitor">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
还尝试在行为部分设置httpsGetEnabled ="true"
also tried setting httpsGetEnabled ="true" in behaviour section
<behavior name="BroadcastMonitorBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpsGetEnabled="true" />
</behavior>
我以各种组合尝试了这些方法,但没有获得任何成功:(
我得到的错误是:
1)找不到与绑定BasicHttpBinding的端点匹配方案https的基地址.注册的基址方案为[http]
2)ServiceMetadataBehavior的HttpsGetEnabled属性设置为true,并且HttpsGetUrl属性是相对地址,但是没有https基地址
I tried these in various combinations but not getting any success :(
The errors i get are:
1)Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http]
2)The HttpsGetEnabled property of ServiceMetadataBehavior is set to true and the HttpsGetUrl property is a relative address, but there is no https base address
推荐答案
看看类似的问题-请在下面回答线程.
http://stackoverflow. com/questions/363285/https-with-wcf-error-could-not-find-base-address-that-matches-scheme-https
http://weblogs.asp.net/srkirkland/archive/2008/02/20/wcf-bindings-needed-for-https.aspx
Have a look at similar Question-Answer threads below.
http://stackoverflow.com/questions/363285/https-with-wcf-error-could-not-find-base-address-that-matches-scheme-https
http://weblogs.asp.net/srkirkland/archive/2008/02/20/wcf-bindings-needed-for-https.aspx
此外,如果托管在IIS上,则需要确保将您的网站配置为SSL ...
如何在IIS上设置SSL 7 [ ^ ]
Also, if hosting on IIS you need to make sure your site is configured for SSL...
How to Set Up SSL on IIS 7[^]
这篇关于服务.svc无法在https上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!