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

  • Home
  • SEARCH
  • 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 5987203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:46:52+00:00 2026-05-22T22:46:52+00:00

I am testing out the CustomUserNamePassword Validator for WCF and so far it only

  • 0

I am testing out the CustomUserNamePassword Validator for WCF and so far it only works if I validate the username test and the password test. If I use something else, such as test1 for the username and test1 for the password, it throws the FaultException. Here is the code the validator:

public override void Validate(string userName, string password)
{
    if (userName != "test" || password != "test")
            throw new FaultException("Username and Password Failed");
}

I am using a Console App to connect to an IIS Hosted Service and I am calling instantiating the credentials like this:

client.ClientCredentials.UserName.UserName = "test";
client.ClientCredentials.UserName.Password = "test";

The above works, but if I hard code the validator to something like test1 and test1 and then do:

client.ClientCredentials.UserName.UserName = "test1";
client.ClientCredentials.UserName.Password = "test1";

The above fails even if I have:

public override void Validate(string userName, string password)
{
    if (userName != "test1" || password != "test1")
            throw new FaultException("Username and Password Failed");
}

I am building the app.config and the ProxyCode with svcutil. Could that have anything to do with it? I did regenerate the code.

I figured out what the problem was. I have 3 solutions (A WCF Service Library, A WCF Website that uses the service library, and a Console App that had code generated from the WCF Service Website url wsdl). I was updating the WCF Service Library, and the Console app, but I was not updating the reference for the website. Once I did this, it all worked fine.

Thanks for the help.

  • 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-22T22:46:53+00:00Added an answer on May 22, 2026 at 10:46 pm

    [updated answer, I had misunderstood the question]

    Is the server side being redeployed? You can try updating the application, or trying to attach a debugger to the server side to see if you have the correct code being run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting out with automated testing and I would like to test one
I personally don't use FxCop yet. We want to work out the unit testing
Im testing out something here,so please excuse the css rules.I have got a ul
I am testing out a WCF service which is running on the same machine
I have been testing out the new WCF fileless activation stuff in .net 4
I am testing out json.net . I would like to use its linq-to-json syntax
I'm testing out a REST service in WCF on .net 4 - i.e. no
I've been testing out the performance and memory profiler AQTime to see if it's
I'm testing out my application with the hopes of migrating to SQL Server 2008
I'm finally starting out with unit testing, having known that I should be doing

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.