inforakesha

A fine WordPress.com site

Publishing Metadata in self Hosting in WCF

Leave a comment

Uri baseAddress = new Uri(“http://localhost:8083/nitjobs”) ;

ServiceHost obj = new ServiceHost(typeof(Job),baseAddress) ;

obj.AddServiceEndpoint(typeof(IJob),
new BasicHttpBinding(), “http://localhost:8083/nitjobs”) ;

ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
obj.AddServiceEndpoint(typeof(IJob), new NetTcpBinding(), “net.tcp://localhost:8088/nitjobs1”);

smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
obj.Description.Behaviors.Add(smb);
obj.Open();
Console.WriteLine(“Started Server – Press any key to terminate”);
Console.ReadKey();

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s