Aynone ever get this to work? This is a critical scenario... the
other critical scenario is having more than one endpoint on the same
IIS hosted service.
[Go-live version]
using System;
using System.ServiceModel;
namespace DemoStuff
{
[ServiceContract]
interface IDemoService
{
[OperationContract]
string GetText( );
}
class DemoService : IDemoService
{
public string GetText( ) {
{
return "Stuff";
}
}
}
class Program
{
static void Main(string[] args) {
Uri basicHttpUri = new
Uri("http://localhost:8081/Service/");
Uri httpDualUri = new
Uri("http://localhost:8082/Service/");
ServiceHost hService = new
ServiceHost(typeof(DemoService));
hService.AddServiceEndpoint(typeof(IDemoService), new
BasicHttpBinding( ), basicHttpUri);
hService.AddServiceEndpoint(typeof(IDemoService), new
WSDualHttpBinding( ), httpDualUri);
hService.Open( );
Console.WriteLine("Service at your service.");
Console.ReadKey( );
hService.Close( );
}
}
}


