我有一个WCF服务,只有将其部署到服务器并通过IIS进行配置后才能正常工作。当我通过IIS Express运行它时,出现以下错误信息:
“主机上配置的身份验证方案('Ntlm、Anonymous')不允许在绑定('BasicHttpBinding')上配置的身份验证方案('Negotiate')。请确保SecurityMode设置为Transport或TransportCredentialOnly。此外,可以通过IIS管理工具更改此应用程序的身份验证方案,通过ServiceHost.Authentication.AuthenticationSchemes属性,在应用程序配置文件中的元素上更新binding的ClientCredentialType属性,或者通过调整HttpTransportBindingElement上的AuthenticationScheme属性来解决此问题。”
我的web.config服务绑定如下:
“主机上配置的身份验证方案('Ntlm、Anonymous')不允许在绑定('BasicHttpBinding')上配置的身份验证方案('Negotiate')。请确保SecurityMode设置为Transport或TransportCredentialOnly。此外,可以通过IIS管理工具更改此应用程序的身份验证方案,通过ServiceHost.Authentication.AuthenticationSchemes属性,在应用程序配置文件中的元素上更新binding的ClientCredentialType属性,或者通过调整HttpTransportBindingElement上的AuthenticationScheme属性来解决此问题。”
我的web.config服务绑定如下:
<services>
<service name="LMS.Services.Services.AppService" behaviorConfiguration="LargeDataRequestBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttp_LargeDataRequestBinding" contract="LMS.Services.Services.AppService" />
<endpoint address="mex" binding="basicHttpBinding" bindingConfiguration="basicHttp_LargeDataRequestBinding" contract="IMetadataExchange" />
</service> </services>
我的绑定看起来像这样:
<bindings>
<basicHttpBinding>
<binding name="basicHttp_LargeDataRequestBinding" receiveTimeout="01:00:00" sendTimeout="01:00:00" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" >
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<basicHttpBinding>
</bindings>
非常感谢任何帮助。