0

So this question has the exact same symptoms of my problem.

Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

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>

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?

Community
  • 1
  • 1
Wayne Werner
  • 49,299
  • 29
  • 200
  • 290
  • Did you try the other option in the question you posted? _Alternativelly you enable Anonymous access in IIS and in your web.config you make sure anonymous access is denied._ – Aaron McIver Dec 21 '11 at 14:20
  • I'm not sure if that setup will work in our environment - though if I can't get this worked out it may be worth checking out. – Wayne Werner Dec 21 '11 at 14:29

1 Answers1

0

I was able to fix this by following the steps found at this msdn post, slightly modified:

  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.

  11. In the Configuration Editor, on the File menu, click Save.

And (as far as I know) this provides authentication using integrated authentication (but not Windows integrated).

Wayne Werner
  • 49,299
  • 29
  • 200
  • 290