none
Two endpoints are generated for a WCF service RRS feed

  • Question

  • Hello,  when I add a Service Reference to a simple WCF service I am getting two endpoints and I don't know why.  The service is simple:

    [ServiceContract(Name = "IOperations", Namespace = Constants.Namespace, ConfigurationName = "IOperations")]
    public interface IOperations
    {
        [OperationContract]
        string DoSomething(string input);
    }

    [ServiceBehavior(Name = "IOperations", Namespace = Constants.Namespace)]
    public class Operations :IOperations
    {
        public string DoSomething(string input)
        {
            return "hello";
        }
     }

    I end up with the following endpoints in my client when I generate the service reference.

    <endpoint address="http://localhost:8701/MyService/Operations/"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Info"
                    contract="Rdc2.IOperations" name="BasicHttpBinding_Info" />

    <endpoint address="http://localhost:8701/MyService/Operations/"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Info"
                    contract="Rdc2.IOperations" name="BasicHttpBinding_Info1" />

    Both endpoints work but I can't figure out why I get two of them.

    Thank you very much!!

    Friday, May 16, 2014 9:18 PM

Answers

  • Well, I changed the service to the following and now I'm only getting one endpoint:

    [ServiceContract(ConfigurationName = "IOperations")]
    public interface IOperations
    {
        [OperationContract]
        string DoSomething(string input);
    }

    public class Operations :IOperations
    {
        public string DoSomething(string input)
        {
            return "hello";
        }
     }

    Friday, May 16, 2014 10:44 PM

All replies

  • Well, I changed the service to the following and now I'm only getting one endpoint:

    [ServiceContract(ConfigurationName = "IOperations")]
    public interface IOperations
    {
        [OperationContract]
        string DoSomething(string input);
    }

    public class Operations :IOperations
    {
        public string DoSomething(string input)
        {
            return "hello";
        }
     }

    Friday, May 16, 2014 10:44 PM
  • Hi,

    I am very glad that you have solved your problem by yourself, if you have any other problems, welcome to post it to this forum.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 19, 2014 3:14 AM
    Moderator