WCF说我的设置要求

WCF说我的设置要求

本文介绍了WCF说我的设置要求“匿名”身份验证 - 但我不希望他们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以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:


  1. 右键单击WCF服务的Web.config文件,然后点击编辑WCF配置

  2. 在配置编辑器,在配置部分,请选择绑定文件夹中。

  3. 在绑定部分,选择新绑定配置

  4. 在创建新绑定对话框中,选择的wsHttpBinding
    点击OK。

  5. 命名绑定配置的一些逻辑和识别的名称的;例如, WsHttpEndpointBinding

  6. 点击安全标签。

  7. 通过从下拉菜单中选择此选项将模式属性为运输

  8. 从下拉列表中选择此选项将 TransportClientCredentialType NTLM


  9. 配置部分,选择 WsHttpEndpoint

  10. 设置BindingConfiguration属性的 WsHttpEndpointBinding 通过从下拉列表中选择此选项。
    此关联绑定配置的绑定设置。

  1. Right-click the Web.config file of the WCF service and then click Edit WCF Configuration.
  2. In the Configuration Editor, in the Configuration section, select the Bindings folder.
  3. In the Bindings section, choose New Binding Configuration.
  4. In the Create a New Binding dialog box, select wsHttpBinding.Click OK.
  5. Set the Name of the binding configuration to some logical and recognizable name; for example, WsHttpEndpointBinding.
  6. Click the Security tab.
  7. Set the Mode attribute to Transport by choosing this option from the drop-down menu.
  8. Set the TransportClientCredentialType to Ntlm by choosing this option from the drop-down list.

  9. In the Configuration section, select WsHttpEndpoint.
  10. 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说我的设置要求“匿名”身份验证 - 但我不希望他们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 07:50