我在 Windows Server 2008 R2 上有一个 WCF。我有一个 SSL 证书。
使用 IE,http URL 工作正常(我得到我的数据),但使用 Https 我有 400 错误请求。
在我的 wcf 的 web.config 下面:
<?xml version="1.0" encoding="utf-8"?>
<bindings>
<basicHttpBinding>
<binding name="TransportSecurity">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceRequestResourcesAspNetAjaxBehavior">
<webHttp defaultOutgoingResponseFormat="Json" />
</behavior>
<behavior name="ServiceRequestResourcesAspNetAjaxBehaviorHttps">
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceRequestResourcesBehaviors">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceRequestResourcesBehaviors"
name="BaseSite.ServiceRequestResources">
<endpoint address=""
behaviorConfiguration="ServiceRequestResourcesAspNetAjaxBehaviorHttps"
binding="basicHttpBinding"
bindingConfiguration="TransportSecurity"
contract="BaseSite.ServiceRequestResources" />
<endpoint address=""
behaviorConfiguration="ServiceRequestResourcesAspNetAjaxBehavior"
binding="webHttpBinding" contract="BaseSite.ServiceRequestResources" />
</service>
</services>