0
votes

I am creating a simple WCF service in VisualStudio 2010. And i am using basicHttpBinding method.

When i view the .svc in the browser, i am getting the following error:

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

My web.config looks like,

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>



    <services>
      <service behaviorConfiguration="IAManagement.Service1Behavior"
        name="IAManagement.Service1">
        <endpoint address="" binding="wsHttpBinding" contract="IAManagement.IService1">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
      <service behaviorConfiguration="IAManagement.CreateIABehavior"
        name="IAManagement.CreateIA">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding"
          name="BasicHttpEndpoint" contract="IAManagement.ICreateIA">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="IAManagement.Service1Behavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="IAManagement.CreateIABehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

Can anyone help me in getting this issue resolved? Thanks

1

1 Answers

0
votes

Your configuration below :

<binding name="BasicHttpEndpointBinding"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" /> </security> </binding> 

is to validate the client using Windows authentication and the same settings has not been configured on IIS.

If you want the client authentication type to be Windows then go into IIS and select the virtual directory and you can find a section called "Authentication". Double click and you can find "Windows Authentication" as one of the elementwhose status should be "Enabled" for your web service to work.

If you dont want any type of authentication then you need to set the security mode to none and that would show your service in the browser.