none
Security settings for this service require 'Basic' Authentication but it is not enabled for the IIS application that hosts this service RRS feed

  • Question

  • <?xml version="1.0"?>
    <configuration>
    <system.serviceModel>
    <behaviors>
    <serviceBehaviors>
    <behavior name="serviceBehavior">
    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
    <serviceDebug includeExceptionDetailInFaults="false"/>
    </endpointBehaviors>
    </behaviors>
    <services>
    <service name="Implementation.Service" behaviorConfiguration="serviceBehavior">
    <endpoint address="" binding="webHttpBinding" contract="Contract.IService" behaviorConfiguration="web" bindingConfiguration="webHttpBinding"></endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
    </services>
    <bindings>
    <basicHttpBinding>
    <binding name="CodeItSoap" closeTimeout="00:01:00">
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Basic" />
    </security>
    </binding>
    </basicHttpBinding>
    <webHttpBinding>
    <binding name="webHttpBinding" closeTimeout="00:01:00">
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Basic" proxyCredentialType="None"realm="">
    </transport>
    </security></binding>
    </webHttpBinding>
    </bindings>
    <client>
    <endpoint address="https://******.****-***/*****_*****?SOAP"
    binding="basicHttpBinding" bindingConfiguration="CodeItSoap"
    contract="Service.CodeItSoap" name="CodeItSoap" />
    </client>
    </system.serviceModel>
    </configuration>

    This is the web config file .I have added a service reference to a web service (https://*******.com/***_**_**.do?SOAP).  The service needs to be authenticated.But i am getting "Security settings for this service require 'Basic' Authentication but it is not enabled for the IIS application that hosts this service" error when i run the .svc file.

      var client = new WCFClientReference.WebService1SoapClient();
                client.ClientCredentials.UserName.UserName = @"[DOMAIN]\[USERNAME]";
                client.ClientCredentials.UserName.Password = @"[PASSWORD]";
                Console.WriteLine(client.HelloWorld());

    as it requires authentication which is different from my windows login so i have done the above client code?Where am i going wrong??Please help.




    Wednesday, November 25, 2015 2:14 PM

Answers

All replies