【发布时间】:2015-09-29 16:54:43
【问题描述】:
基本上我想创建一个 https 安全的 Restful WCF 服务。因此,我将 webhttpbinding 用于我的服务,因为它支持创建 RESTful 服务。最好我本来想用单实例 EBS 来做,但 EBS 不支持 SSL 证书。在 C#/.net 平台上进行配置,所以我设置了一个负载均衡器,将我的证书上传到 IAM 并在 ELB 上打开了侦听器。但无论我做什么,我的 web.config 似乎都不起作用。你能帮我弄清楚我的web.config ...`
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<customErrors mode="Off" />
</system.web>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="webHttpBinding_ICustomerService" crossDomainScriptAccessEnabled="true">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
</security>
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:44300/CustomerService/CustomerService.svc"
binding="basicHttpsBinding" bindingConfiguration="" contract="WcfService2.ICustomerService"
name="" kind="" endpointConfiguration="" />
</client>
<services>
<service name="WcfService2.Service1" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBinding_ICustomerService"
behaviorConfiguration="webHttpBehavior" contract="WcfService2.ICustomerService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpsGetUrl="mex"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttpBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="0" multipleSiteBindingsEnabled="true">
<baseAddressPrefixFilters>
<add prefix="https://example.com/" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
</system.serviceModel>
`
【问题讨论】: