IIS で Windows 認証を有効にして匿名を無効に設定すると、次のエラーが発生します。
ホストで構成された認証スキーム ('IntegratedWindowsAuthentication') は、バインディング 'BasicHttpBinding' ('Anonymous') で構成されたものを許可しません。SecurityMode が Transport または TransportCredentialOnly に設定されていることを確認してください。さらに、この問題は、IIS 管理ツール、ServiceHost.Authentication.AuthenticationSchemes プロパティ、アプリケーション構成ファイル内のエレメント、バインディングの ClientCredentialType プロパティの更新、または調整によって、このアプリケーションの認証スキームを変更することによって解決される場合があります。 HttpTransportBindingElement の AuthenticationScheme プロパティ。
私のWcfサービスのweb.configは次のとおりです...
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint binding="basicHttpBinding"
bindingConfiguration="BasicHttpEndpointBinding"
contract="Test.IService1" name="BasicHttpEndpoint" />
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceAuthenticationManager
authenticationSchemes="IntegratedWindowsAuthentication"/>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
ご意見をお聞かせください..