【发布时间】:2011-02-23 16:41:51
【问题描述】:
是否可以仅使用BasicHttpBinding-binding 在 IIS 中设置具有 SSL 和基本身份验证的 WCF 服务?
(我不能用wsHttpBinding-binding)
该站点托管在 IIS 7 上,并设置了以下身份验证:
- 匿名访问:关闭
- 基本身份验证:开启
- 集成 Windows 身份验证:关闭
服务配置:
<services>
<service name="NameSpace.SomeService">
<host>
<baseAddresses>
<add baseAddress="https://hostname/SomeService/" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<endpoint address="" binding="basicHttpBinding"
bindingNamespace="http://hostname/SomeMethodName/1"
contract="NameSpace.ISomeInterfaceService"
name="Default"
/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
<exceptionShielding/>
</behavior>
</serviceBehaviors>
</behaviors>
我尝试了 2 种类型的 绑定,但出现了两个不同的错误:
-
1。 IIS 错误:
'找不到与绑定 BasicHttpBinding 的端点的方案 http 匹配的基地址。注册的基地址方案是 [https]。
<bindings> <basicHttpBinding> <binding> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Basic"/> </security> </binding> </basicHttpBinding> </bindings> -
2。 IIS 错误:
此服务的安全设置需要“匿名”身份验证,但托管此服务的 IIS 应用程序未启用。
<bindings> <basicHttpBinding> <binding> <security mode="Transport"> <transport clientCredentialType="Basic"/> </security> </binding> </basicHttpBinding> </bindings>
有人知道如何正确配置吗? (如果可能?)
【问题讨论】:
标签: wcf ssl wcf-binding wcf-security basichttpbinding