【发布时间】:2013-10-06 10:47:36
【问题描述】:
在我的 WCF 服务中,我试图通过 SSL 连接使用 JSON 向客户端发送数据。我能够使用wsHttpBinding 以Transport 的安全模式将OData 数据库源保护到我的客户端。为什么webHttpBinding 不能做同样的事情来使用 SSL?我将如何配置需要使用 JSON 来使用 SSL 连接的端点?
本质上webHttpBinding 和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" />
【问题讨论】:
标签: json wcf ssl web-config