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 71669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:55:27+00:00 2026-05-10T19:55:27+00:00

I was running my first Visual Studio 2008 Unit Test with a WCF Service

  • 0

I was running my first Visual Studio 2008 Unit Test with a WCF Service and I received the following error:

Test method UnitTest.ServiceUnitTest.TestMyService threw exception: System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme ‘Anonymous’. The authentication header received from the server was ‘Negotiate,NTLM’. —> System.Net.WebException: The remote server returned an error: (401) Unauthorized..

I am also getting the following failed audit in the security log:

Logon Failure: Reason: The user has not been granted the requested logon type at this machine
User Name: (Internet Guest Account)
Domain:
Logon Type: 3
Logon Process: IIS
Authentication Package:
MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Workstation Name:

I am hosting the WCF service in IIS 6.0 on a Windows XP SP3 machine. I have both the ‘Anonymous Access’ and ‘Integrated Windows authentication’ checked for the WCF service virtual directory.

Here is my config file for the service:

<system.serviceModel>     <services>         <bindings>             <basicHttpBinding>                 <binding name='MyBinding'>                <security mode='None' />            </binding>             </basicHttpBinding>             <customBinding>                 <binding name='MyBinding'>                <transactionFlow />                     <textMessageEncoding />                     <httpsTransport authenticationScheme='Ntlm'/>                 </binding>             </customBinding>             <wsHttpBinding>                 <binding name='MyBinding'>                    <security mode='None' />                </binding>             </wsHttpBinding>         </bindings>         <service              behaviorConfiguration='Service1Behavior'             name='Service1'         >             <endpoint                  address=''                  binding='wsHttpBinding'                 bindingConfiguration='MyBinding'                 contract='IService1'             >                 <identity>                     <dns value='localhost' />                    </identity>             </endpoint>         </service>     </services>     <behaviors>         <serviceBehaviors>             <behavior name='Service1Behavior'>                 <serviceMetadata httpGetEnabled='true' />                    <serviceDebug includeExceptionDetailInFaults='false' />                </behavior>         </serviceBehaviors>     </behaviors> </system.serviceModel> 
  • 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. 2026-05-10T19:55:27+00:00Added an answer on May 10, 2026 at 7:55 pm

    I had to change the following IIS and WCF service configurations to get past the ‘Negotiate,NTLM’ exception.

    IIS Configurations:

    — Unchecked ‘Anonymous Access’ checkbox and check the ‘Integrated Windows authentication’ checkbox in the directory security setting for the WCF Service virtual directory.

    WCF Services:

    — implemented basicHttpBinding and configured the basicSettingBinding security setting to ‘TransportCredentialsOnly’ mode and TransportClientCredentialType to ‘Windows’

    Here is my updated wcf service configuration:

    <system.serviceModel>     <bindings>         <basicHttpBinding>             <binding name='windowsBasicHttpBinding'>                 <security mode='TransportCredentialOnly'>                     <transport clientCredentialType='Windows' />                 </security>             </binding>        </basicHttpBinding>     </bindings>     <services>         <service           behaviorConfiguration='CityOfMesa.ApprovalRouting.WCFService.RoutingServiceBehavior'            name='CityOfMesa.ApprovalRouting.WCFService.RoutingService'         >             <endpoint                  binding='basicHttpBinding' bindingConfiguration='windowsBasicHttpBinding'                 name='basicEndPoint'                     contract='CityOfMesa.ApprovalRouting.WCFService.IRoutingService'              />         </service>     </services>     <behaviors>         <serviceBehaviors>             <behavior                  name='CityOfMesa.ApprovalRouting.WCFService.RoutingServiceBehavior'             >                 <serviceMetadata httpGetEnabled='true' />                 <serviceDebug includeExceptionDetailInFaults='true' />            </behavior>         </serviceBehaviors>     </behaviors> </system.serviceModel> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 213k
  • Answers 213k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A bit late, but if you require 'io/wait', you can… May 12, 2026 at 10:36 pm
  • Editorial Team
    Editorial Team added an answer You don't need D-Bus, simply listen to changes for the… May 12, 2026 at 10:36 pm
  • Editorial Team
    Editorial Team added an answer email-spec looks like a good library http://github.com/bmabey/email-spec May 12, 2026 at 10:36 pm

Related Questions

I have two programs written in C++ that use Winsock. They both accept TCP
Since our switch from Visual Studio 6 to Visual Studio 2008, we've been using
Visual Studio is x86 until at least the 2010 release comes around update: this
I am trying to debug a WCF service. This client has been able to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.