Reputation: 15702
I have a WCF service, which implements interface PosData.ISampleService
in class PosData.SampleService
. The service is self hosted and the start up code looks like this:
ServiceHost serviceHost = new ServiceHost(typeof(SampleService), new Uri("http://localhost:8080/sample"));
serviceHost.Open();
Console.WriteLine("Service started.");
Console.ReadLine();
The app.config contains the following lines:
<services>
<service name="PosData.SampleService">
<endpoint address="http://localhost:8080/sample" contract="PosData.ISampleService" kind="webHttpEndpoint"/>
</service>
</services>
I would like to get rid of the App.config configuration, but I have no idea how to configure webHttpEndpoint
via code. How can I do that?
Upvotes: 1
Views: 737