是否可以仅使用 IIS 在 IIS 中设置具有 SSL 和基本身份验证的 WCF 服务BasicHttpBinding-binding
?
(我不能使用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>
我尝试了两种类型的绑定,但有两种不同的错误:
- 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>
有谁知道如何正确配置它?(如果可能吗?)