using System.ServiceModel; namespace HelloServicehost { class Program { static void Main() { using (ServiceHost host = new ServiceHost(typeof(WcfServices.HelloService))) { host.Open(); Console.WriteLine("Hello service started at " + DateTime.Now.ToString()); Console.ReadLine(); } } } }
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <services> <service name="WcfServices.HelloService" behaviorConfiguration="mexBehaviour"> <endpoint address="HelloService" binding="basicHttpBinding" contract="WcfServices.IHelloService"></endpoint> <endpoint address="HelloService" binding="netTcpBinding" contract="WcfServices.IHelloService"></endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint> <host> <baseAddresses> <add baseAddress="http://localhost:8080/"/> <add baseAddress="net.tcp://localhost:8090/"/> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="mexBehaviour"> <serviceMetadata httpGetEnabled="true"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)