Setting ClientCredentials: getting "Username is not provided" error

19,493

Do you have security mode, clientCredentialtype configured appropriately in your configuration files? Here is a blog post that very closely matches your question. I hope this helps!

http://amadotech.blogspot.com/2009/11/error-username-is-not-provided-specify.html

Actually there're three causes with my application:

  1. Security mode was not appropriae.
  2. Client credential type was not appropriate.
  3. The call missed passing the required Username and password.
Share:
19,493

Related videos on Youtube

Chetan
Author by

Chetan

Updated on June 04, 2022

Comments

  • Chetan
    Chetan almost 2 years

    I'm tasked with creating a WCF service from a local wsdl file. I have done some R&D on this task. I have added a web reference of that local wsdl file. Now I want to create a client for this service in order access the service.

    How do I provide the username and password in the client?

    Currently, when I am accessing the service methods in the client I get an error:

    Username is not provided.

    Here's the relevant code:

     ServiceGetProductFeeds.ProductFeedServiceClient  SerProdFeeds = new ServiceGetProductFeeds.ProductFeedServiceClient();
     SerProdFeeds.ClientCredentials.UserName.UserName = "XXXXXX";
     SerProdFeeds.ClientCredentials.UserName.Password = "*******";
     SerProdFeeds.getProductFeed(); 
    

    Any tips on what's not correct with the above code?

  • Chetan
    Chetan over 11 years
    Hello, thanks for your reply, I have try the configuration that mention in given link in my app.config file, But now I am getting the following error "The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via", Any help on this