问题描述
所以this问题有我的问题完全相同的症状。
So this question has the exact same symptoms of my problem.
此服务的安全设置要求匿名身份验证,但没有为承载此服务的IIS应用程序启用。
不过,我从我的web配置删除 MEX
终点,我仍然得到同样的错误。我的web配置是这样的:
However, I've removed the mex
endpoint from my web config and I still get the same error. My web config looks like this:
<system.serviceModel>
<services>
<service name="xxx.MessageHub.MessageHubService"
behaviorConfiguration="default">
<endpoint binding="wsHttpBinding"
contract="xxx.MessageHub.IMessageHubService" />
</service>
</services>
<behaviors>
<endpointBehaviors>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="default">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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="true"/>
<serviceAuthorization principalPermissionMode="UseWindowsGroups" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="credsOnly">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows"></transport>
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="transport">
<security mode="Transport">
<transport clientCredentialType="Windows"></transport>
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
我运行的IIS6兼容性的应用程序添加到IIS7。(因为我们的督促服务器上运行的IIS6 - 我得到同样的异常时,部署到测试服务器)
I'm running the application with the IIS6 compatibility add on to IIS7 (because our prod servers run IIS6 - I get the same exception when deployed to the test server).
什么设置,我需要解决,使这个东西工作?
What settings do I need to fix to make this stuff work?
推荐答案
我能够按照这个发现的步骤的,略作修改:
I was able to fix this by following the steps found at this msdn post, slightly modified:
- 右键单击WCF服务的Web.config文件,然后点击编辑WCF配置
- 在配置编辑器,在配置部分,请选择绑定文件夹中。
- 在绑定部分,选择新绑定配置
- 在创建新绑定对话框中,选择的wsHttpBinding 。
点击OK。 - 将命名绑定配置的一些逻辑和识别的名称的;例如, WsHttpEndpointBinding
- 点击安全标签。
- 通过从下拉菜单中选择此选项将模式属性为运输
- 从下拉列表中选择此选项将 TransportClientCredentialType 为 NTLM
- 在配置部分,选择 WsHttpEndpoint
-
设置BindingConfiguration属性的 WsHttpEndpointBinding 通过从下拉列表中选择此选项。
此关联绑定配置的绑定设置。
- Right-click the Web.config file of the WCF service and then click Edit WCF Configuration.
- In the Configuration Editor, in the Configuration section, select the Bindings folder.
- In the Bindings section, choose New Binding Configuration.
- In the Create a New Binding dialog box, select wsHttpBinding.Click OK.
- Set the Name of the binding configuration to some logical and recognizable name; for example, WsHttpEndpointBinding.
- Click the Security tab.
- Set the Mode attribute to Transport by choosing this option from the drop-down menu.
- Set the TransportClientCredentialType to Ntlm by choosing this option from the drop-down list.
- In the Configuration section, select WsHttpEndpoint.
Set the BindingConfiguration attribute to WsHttpEndpointBinding by choosing this option from the drop-down list.This associates the binding configuration setting with the binding.
在配置编辑器,在文件菜单上,单击保存。
In the Configuration Editor, on the File menu, click Save.
和(据我所知)使用这个集成的身份验证(而不是Windows集成)提供认证
And (as far as I know) this provides authentication using integrated authentication (but not Windows integrated).
这篇关于WCF说我的设置要求“匿名”身份验证 - 但我不希望他们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!