基本上我想创建一个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>
`
答案 0 :(得分:0)
看来您在端点上使用basicHttpsBinding,同时提供了http://地址,这会导致不匹配的方案错误。