WCF service can be hosted with IIS, Self hosting & WAS server.
Self Hosting : In self hosting of WCF service we can host the service in our own application domain.
Whole WCF service can consists in an assembly, as you run the application (assembly) service got started and can be accessed.
Port you are using for service should not be in use by other IIS site and this port should be open on server in order to access it publicly.
Source Code:
Self Hosting : In self hosting of WCF service we can host the service in our own application domain.
Whole WCF service can consists in an assembly, as you run the application (assembly) service got started and can be accessed.
Port you are using for service should not be in use by other IIS site and this port should be open on server in order to access it publicly.
Source Code:
Self hosting class
namespace ConsoleApplication1
namespace ConsoleApplication1
{
public class
clsSelfHosting
{
static void Main(string[]
args)
{
ServiceHost host;
Uri uri = new Uri("http://localhost:1300/MyWCFSelfHosting");
host = new ServiceHost(typeof(ConsoleApplication1.Service1), uri);
host.AddServiceEndpoint(typeof(IService1), new WSHttpBinding(), "");
ServiceMetadataBehavior
smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
host.Description.Behaviors.Add(smb);
host.Open();
Console.WriteLine("Service Started...");
Console.ReadLine();
}
}
}




