gpt4 book ai didi

json - 如何保护 webHttpBinding?

转载 作者:太空宇宙 更新时间:2023-11-03 12:41:08 25 4
gpt4 key购买 nike

在我的 WCF 服务中,我试图通过 SSL 连接使用 JSON 将数据发送到客户端。我能够使用 wsHttpBindingTransport 安全模式将 OData 数据库源保护到我的客户端。为什么 webHttpBinding 不能为了使用 SSL 而做同样的事情?我将如何配置需要使用 JSON 的端点来使用 SSL 连接?

webHttpBindingwsHttpBinding 本质上有什么区别?

<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" />

最佳答案

我认为这篇文章将解决您的问题。 Creating a WCF RESTful Service And Secure It Using HTTPS Over SSL

关于json - 如何保护 webHttpBinding?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19096480/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com