It seems that when trying to get from my service a launch to the service endpoint was not found.
if I try http: // localhost: 8000 / hello / help I should expect to see <string>You entered help <string> , but instead I get only the endpoint? I didn’t touch my configuration files at all, and I'm just hosting from a console application.
Leading:
namespace Host { class Program { static void Main(string[] args) { WebHttpBinding binding = new WebHttpBinding(); WebServiceHost host = new WebServiceHost(typeof(Service1)); host.AddServiceEndpoint(typeof(IService1), binding, "http://localhost:8000/hello"); host.Open(); Console.WriteLine("Hello world service"); Console.WriteLine("Press <RETURN> to end service"); Console.ReadLine(); } } }
Service1:
namespace WcfServiceLibrary1 { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together. public class Service1 : IService1 { public string GetData(string value) { return string.Format("You entered: {0}", value); }
IService1:
[ServiceContract] public interface IService1 { [WebGet(UriTemplate = "/{value}")] string GetData(string value);
source share