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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:11:35+00:00 2026-05-26T00:11:35+00:00

I get the following error when i try to consume my wcf service Could

  • 0

I get the following error when i try to consume my wcf service

Could not find endpoint element with name ‘http://localhost:8080/Provider/basic’ and contract ‘Provider.IProvider’ in the ServiceModel client configuration section

I can however connect to my base address through the WCF Test Client on http://localhost:8080/Provider

I’ve tried updating my service reference and that didn’t work, Anyone know what is wrong with my setup

    public ServiceHost ProviderServiceHost { get; set; }

    private void StartProvider()
    {
        if (ProviderServiceHost != null)
            Abort();
        ProviderServiceHost = new ServiceHost(typeof(Provider), new Uri("http://localhost:8080/Provider"));
        var binding = new BasicHttpBinding
        {
            Name = "basicBinding",
            HostNameComparisonMode = HostNameComparisonMode.WeakWildcard,
            Security = { Mode = BasicHttpSecurityMode.None }
        };

        var metadataBehavior = ProviderServiceHost.Description.Behaviors.Find<ServiceMetadataBehavior>();
        if (metadataBehavior == null)
        {
            metadataBehavior = new ServiceMetadataBehavior { HttpGetEnabled = true };
            ProviderServiceHost.Description.Behaviors.Add(metadataBehavior);
        }

        ProviderServiceHost.AddServiceEndpoint(typeof(IProvider), binding, "http://localhost:8080/Provider/basic");

        ProviderServiceHost.Open();
    }

My client is connecting like this

  private static ProviderClient _proxy = new ProviderClient(http://localhost:8080/Provider/basic);

If i don’t put in an address then i get this exception

Message “Could not find default endpoint element that references contract ‘Provider.IProvider’ in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.” string

  • 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-26T00:11:35+00:00Added an answer on May 26, 2026 at 12:11 am

    Are you using client side configuration? As it appears you’re using the ClientBase proxy I expect you’ve used ‘Add Service Reference…’ and are just the default configuration file.

    The overload that you’re using is new ServiceClient(string endpointConfigurationName) – the string value represents a Name, not an Address. If you check your configuration file you should see a client section has been added:

    <client>
        <endpoint address="http://localhost:8080/Provider/basic" 
                  binding="basicHttpBinding"
                  bindingConfiguration="basicBinding_IProvider" 
                  contract="ServiceReference1.ITest"
                  name="basicBinding_IProvider" />
    </client>
    

    So if you change your Client constructor to use this Name property it should work better for you.

    private static ProviderClient _proxy = 
        new ProviderClient("basicBinding_IProvider");
    

    On the other hand if you are not using a configuration file and want to specify the address in code, you can use a different ClientBase constructor:

    using System.ServiceModel;
    // ...
    
    _client = new ProviderClient(new BasicHttpBinding(), 
                new EndpointAddress("http://localhost:8080/Provider/basic"));
    

    There are a number of different overloads in the ClientBase class (your ProviderClient) which allow you to specify various properties.

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

Sidebar

Related Questions

I get the following error when I try to access http://localhost:8000/api/goal/?format=json : ImproperlyConfigured at
I am trying to consume a .net web service, and get the following error
I get following error message, when I try to run git rebase -i for
I get the following error when I try and execute the code down below.
I get the following error when I try to run sample example of Google
I get the following error message when I try the following: Dim XL As
I get the following error on my Cloud Foundry installation when I try to
I get the following error in the UDK Frontend when I try to make
When I try to I get the following error in SQL Server Management Studio:
When I try to start an IntentService over adb i get tho following error

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.