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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:52:56+00:00 2026-06-03T00:52:56+00:00

I am trying to get a WCF Service working so it has simple message

  • 0

I am trying to get a WCF Service working so it has simple message username/password access.

Whenever I try and access the service with the current setup it says:

Metadata publishing for this service is currently disabled.

my web.config

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="Binding1">
          <!-- UsernameToken over Transport Security -->
          <security mode="Message" >
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
      </wsHttpBinding>

    </bindings>
    <services>
      <service name="MyService" behaviorConfiguration="ServiceBehavior">
        <endpoint address="http://localhost/Service.svc" binding="wsHttpBinding" contract="IService" bindingConfiguration="Binding1">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior  name="ServiceBehavior">
          <!-- 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="false"/>
          <serviceCredentials>

            <!-- Use our own custom validation -->
            <userNameAuthentication userNamePasswordValidationMode="Custom"
                                                customUserNamePasswordValidatorType="WebApplication5.MyValidator, WebApplication5"/>
          </serviceCredentials>

        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

my MyService.svc:

namespace WebApplication5
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the    
class name "MyService" in code, svc and config file together.
    public class MyService : IMyService
    {
        public string DoWork()
        {
            return "You Got It";
        }
    }
}

my MyValidator.cs:

namespace WebApplication5
{
    class MyValidator : UserNamePasswordValidator
    {
        public override void Validate(string userName, string password)
        {
            if ((userName == "shiv123") && (password == "pass123"))
            {
            }
            else
            {
                throw new FaultException("Invalid credentials");
            }
        }
    }
}
  • 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-06-03T00:52:57+00:00Added an answer on June 3, 2026 at 12:52 am

    Your service in the XML should contain the namespace.

    Try with :

    <service name="WebApplication5.MyService" ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get going with a new WCF service. The service was working
Im trying to get an image from a wcf rest service like so: [ServiceContract]
I'm trying to get this sample for AJAX to WCF working, with the following
I am trying the simple senario of running a WCF service to return Active
I'm trying to get IIS6 to work reliably with a WCF service I have
I'm trying to get WCF working with Silverlight. I'm a total beginner to WCF
I've been trying to get WCF security working for my project, and have had
I'm working on a WCF service, in which I'm trying to load data from
I'm trying to expose a simple WCF REST service using data from Linq to
I'm trying to get WCF duplex communication working an I'm struggling as I keep

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.