如何保护webHttpBinding? [英] How to secure webHttpBinding?
问题描述
在我的WCF服务中,我试图通过SSL连接使用JSON将数据发送到客户端.我可以使用wsHttpBinding
和Transport
的安全模式将OData数据库源保护到我的客户端.为什么webHttpBinding
不能为了使用SSL而做同样的事情?如何配置需要使用JSON才能使用SSL连接的端点?
In my WCF service I am trying to to send data to the client using JSON over an SSL connection. I was able to secure the OData database source to my client using wsHttpBinding
with a security mode of Transport
. Why is webHttpBinding
not able to do the same in order to use SSL? How would I configure an endpoint that needs to use JSON to use an SSL connection as well?
基本上webHttpBinding
和wsHttpBinding
有什么区别?
Essentially what is the difference between webHttpBinding
and wsHttpBinding
?
<bindings>
<wsHttpBinding>
<binding name="TransportSecurity">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="EndpBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceBehavior" name="DataService4.DataService">
<endpoint address="" binding="webHttpBinding" contract="DataService4.IService" bindingConfiguration="TransportSecurity" behaviorConfiguration="EndpBehavior" />
<endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="mex" />
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
推荐答案
我认为本文将解决您的问题. 创建WCF RESTful服务并确保安全它通过SSL使用HTTPS
I think this article will solve your problem. Creating a WCF RESTful Service And Secure It Using HTTPS Over SSL
这篇关于如何保护webHttpBinding?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!