|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Services.Registration;
namespace Services.Registration.Host
{
public class Host
{
ServiceHost host;
public void StartService()
{
try
{
host = new ServiceHost(typeof(RegistrationService));
host.AddServiceEndpoint(typeof(IRegistrationService),
new BasicHttpBinding(),
"http://localhost:8000/RegistrationService");
host.Open();
Console.WriteLine("Service Started Successfully");
Console.ReadLine();
}
catch (System.Exception exception)
{
Console.WriteLine("Unable to start service \n " + exception.Message);
}
}
public void StopService()
{
if (host != null)
host.Close();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Adil is an aspiring software craftsman. He is currently working as Senior Developer at Nintex and has extensive experience on designing and developing enterprise scale applications on Microsoft .NET Framework. Lately he is into cross platform mobile app development on Windows, Android and iOS.
Besides, day to day job, he is active in offline and online technical communities and often participates as speaker in technical events.
He blogs about his experience at http://www.AdilMughal.com