Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My Web.confing

<?xml version="1.0" encoding="UTF-8"?>
        <behavior name="MyOwnBehavior">
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="WcfService_Project.UNValidator,WcfService_Project" />

        <binding name="MyOwnBinding">
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="None" />
            <message clientCredentialType="UserName" />

      <service behaviorConfiguration="MyOwnBehavior" name="WcfService_Project.Service1">
        <endpoint address="https://localhost/WcfService_Project/Service1" binding="wsHttpBinding" bindingConfiguration="MyOwnBinding" name="TestWCFService.Http" contract="WcfService_Project.IService1" />
            <add baseAddress="https://localhost/WcfService_Project/Service1" />
    <compilation debug="true" />
    <directoryBrowse enabled="true" />


<pre lang="c#">
EndpointAddress ep = new EndpointAddress(new Uri(
            //transport encrypting with SOAP message authentication
            WSHttpBinding bind = new WSHttpBinding(
            //10 sec timeouts
            bind.ReceiveTimeout = new TimeSpan(0, 0, 10);
            bind.SendTimeout = new TimeSpan(0, 0, 10);
            bind.BypassProxyOnLocal = false; // to be able bedugging eg. with fiddler
            bind.UseDefaultWebProxy = true; //use default system proxy
            //this we need for our custom credentials
            bind.Security.Message.ClientCredentialType =

            ServiceReference1.Service1Client obj = new ServiceReference1.Service1Client(bind, ep);
            obj.ClientCredentials.UserName.UserName = "test";
            obj.ClientCredentials.UserName.Password = "best";
            return obj;

Error: There was no endpoint listening at https://localhost/WcfService_ProjNew/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

I tried to connect with system name(https://localhost/WcfService_ProjNew/Service1.svc[^]) also but same error.

Where I have done wrong.

Thanks in advance
Updated 19-Dec-13 23:56pm
Jobless Creature 20-Dec-13 22:33pm    
Can you try setting the name attribute with the class name?


can be changed to service class name.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900