Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6860983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:28:39+00:00 2026-05-27T02:28:39+00:00

Having some trouble using basic authentication with a simple test Wcf service. I am

  • 0

Having some trouble using basic authentication with a simple test Wcf service. I am getting an exception:

The requested service, ‘http://qld-tgower/test/Service.svc’ could not be activated. See the > server’s diagnostic trace logs for more information.

And in the trace log it shows:

The authentication schemes configured on the host (‘Basic’) do not allow those configured on the binding ‘BasicHttpBinding’ (‘Anonymous’). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly. Additionally, this may be resolved by changing the authentication schemes for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property, in the application configuration file at the <serviceAuthenticationManager> element, by updating the ClientCredentialType property on the binding, or by adjusting the AuthenticationScheme property on the HttpTransportBindingElement.

But what I don understand it when I us the incorrect username and password it says it IS using basic authentication?

The HTTP request is unauthorized with client authentication scheme ‘Basic’. The authentication header received from the server was ‘Basic realm=”qld-tgower”‘.

This is my web.config details

<system.serviceModel>
<services>
  <service name="WcfService"
      behaviorConfiguration="Behavior">
    <endpoint address="http://QLD-TGOWER/test/Service.svc"
              binding="basicHttpBinding"
              bindingConfiguration="httpBinding"
              contract="IService" />
  </service>
</services>
<diagnostics>
  <endToEndTracing activityTracing="false" messageFlowTracing="true" propagateActivity="true"></endToEndTracing>
</diagnostics>
<bindings>
  <basicHttpBinding>
    <binding name="httpBinding">
      <security mode="TransportCredentialOnly">
        <transport  clientCredentialType="Basic" proxyCredentialType="Basic">
        </transport>
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- 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"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>

and this is my App.config

<system.serviceModel>
    <diagnostics>
      <endToEndTracing activityTracing="true" />
      <messageLogging logMessagesAtTransportLevel="true" />
    </diagnostics>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService" >
          <security mode="TransportCredentialOnly">

            <transport clientCredentialType="Basic" proxyCredentialType="Basic"></transport>
            <message clientCredentialType="UserName" />
          </security>

        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://QLD-TGOWER/test/Service.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IService" contract="ServiceReference1.IService"
        name="BasicHttpBinding_IService" />
    </client>
</system.serviceModel>

my test application

private static void Main(string[] args)
{
    var proxy = new ServiceClient("BasicHttpBinding_IService");
    var clientCredentials = proxy.ClientCredentials;
    clientCredentials.UserName.UserName = "username";
    clientCredentials.UserName.Password = "password";
    var res = proxy.GetData(1);
    Console.WriteLine(res);
    Console.WriteLine("Done");
    Console.ReadKey(true);
}

And my service

public class Service : IService
{

   public string GetData(int value)
   {
       return string.Format("You entered: {0}", value);
   }
}

Is there something that I am missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:28:39+00:00Added an answer on May 27, 2026 at 2:28 am

    Change the name and contract of the service to include the namespace.

    Also, remove the endpoint address (set it to “”) and don’t include proxyCredentialType in the transport tag.

    End result of the web.config should look something like this

      <system.serviceModel>
    
        <services>
          <service name="MyNameSpace.MyService" behaviorConfiguration="asdf">
            <endpoint address="" binding="basicHttpBinding" 
                bindingConfiguration="httpBinding" contract="MyNameSpace.IMyService" />
          </service>
        </services>
    
        <diagnostics>
          <endToEndTracing activityTracing="true" messageFlowTracing="true" 
              propagateActivity="true">
          </endToEndTracing>
        </diagnostics>
    
        <bindings>
          <basicHttpBinding>
            <binding name="httpBinding">
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Basic" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
    
        <behaviors>
          <serviceBehaviors>
            <behavior name="asdf">
              <!-- 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" />
    
            </behavior>
          </serviceBehaviors>
        </behaviors>
    
        <serviceHostingEnvironment multipleSiteBindingsEnabled="false"/>
    
      </system.serviceModel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I'm having some trouble using regular expression to get date in a string. Example
Basically having some trouble with using Hover to hide or show an item. The
I am having some trouble trying to checkout the BitSharp source code using SVN.
I have created some rounded navigation tabs using CSS and am having trouble when
I'm using Hibernate's JPA impl to model some tables. I'm having trouble mapping a
Having some trouble with what should be a very simple scenario. For example purposes,
I'm having some trouble with a program using pthreads, where occassional crashes occur, that
I'm having some trouble using EWS with tasks and reminders, specifically, the due date.
I'm having some trouble using sessions with php.. I think I have figured out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.