我如何WCF JSON绑定到多个绑定HTTPS? [英] How do I bind WCF json to https with multiple bindings?
本文介绍了我如何WCF JSON绑定到多个绑定HTTPS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用WCF绑定Web服务,以SOAP和JSON。我必须在生产中运行SSL。我已经绑定的SOAP地址为https,但我无法弄清楚如何绑定JSON地址为https。这里是我的配置。
I am using WCF to bind webservices to SOAP and JSON. I must run ssl in production. I've bound the soap address to https, but I cannot figure out how to bind the JSON address to https. Here is my config.
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="EnterpriseServices.Service.AuthorizationServiceBase">
<endpoint address="soap" binding="basicHttpBinding" contract="EnterpriseServices.Contracts.Authorization.IAuthorizationManagerBase" />
<endpoint address="soap" binding="basicHttpsBinding" contract="EnterpriseServices.Contracts.Authorization.IAuthorizationManagerBase" />
<endpoint address="json" binding="webHttpBinding" behaviorConfiguration="jsonBehavior" contract="EnterpriseServices.Contracts.Authorization.IAuthorizationManagerBase" />
</service>
...
有没有protocolMapping我可以加我的JSON端点,我可以使用绑定到https?
Is there a protocolMapping I can add for my "json" endpoint that I can use to bind to https?
推荐答案
你有设置您的绑定运送安全模式?
Do you have the security mode set to Transport in your bindings?
<webHttpBinding>
<binding name="jsonpSsl">
<security mode="Transport" />
</binding>
</webHttpBinding>
看看这个答案: WCF服务与JSONP通过SSL
这篇关于我如何WCF JSON绑定到多个绑定HTTPS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文