J
Jon Davis
Newbie to WCF here. I am getting the error "unable to open its
IChannelListener", but the service is running as an admin, and on a
different port from anything else. If it matters, I'm trying to run multiple
instances
of the same service name on different schemes/ports, so that WAN users can
use
HTTP/SOAP, LAN users can use TCP, and localhost users can use named pipes.
Apparently, this isn't doable. I suspect a service name conflict? Since the
service name is the fully qualified classname w/ namespace, do I create a
whole new service class for each scheme?
Some sample code below. Only works when I comment out all but the http bits.
Fails otherwise on tcpServiceHost.Open(); regarding the HTTP uri
http://localhost:8080/Bleah/Admin (weird?!).
---------------
internal static ServiceHost httpServiceHost = null;
internal static ServiceHost tcpServiceHost = null;
internal static ServiceHost pipeServiceHost = null;
internal static void StartService()
{
// Consider putting the baseAddress in the configuration system
// and getting it here with AppSettings
Uri baseAddress = new Uri("http://localhost:8080/Bleah/Admin");
// Instantiate new ServiceHost
httpServiceHost = new ServiceHost(typeof(AdminService), baseAddress);
httpServiceHost.Open();
// tcp service
// Consider putting the baseAddress in the configuration system
// and getting it here with AppSettings
baseAddress = new Uri("net.tcp://localhost:2062/Bleah/Admin");
tcpServiceHost = new ServiceHost(typeof(AdminService), baseAddress);
tcpServiceHost.Open();
// pipes service
// Consider putting the baseAddress in the configuration system
// and getting it here with AppSettings
baseAddress = new Uri("net.pipe://localhost/Bleah/Admin");
pipeServiceHost = new ServiceHost(typeof(AdminService), baseAddress);
pipeServiceHost.Open();
}
....
<service name="BleahAdminService" behaviorConfiguration="returnFaultsHttp">
<!--<endpoint contract="IMetadataExchange" binding="mexHttpBinding"
address="true" />-->
<endpoint contract="BleahIAdminService"
binding="wsHttpBinding"
address="http://localhost:8080/Bleah/Admin" />
<endpoint contract="BleahIAdminService"
binding="netTcpBinding"
address="net.tcp://localhost:2060/Bleah/Admin" />
<endpoint contract="BleahIAdminService"
binding="netNamedPipeBinding"
address="net.pipe://localhost/Bleah/Admin" />
</service>
Jon
IChannelListener", but the service is running as an admin, and on a
different port from anything else. If it matters, I'm trying to run multiple
instances
of the same service name on different schemes/ports, so that WAN users can
use
HTTP/SOAP, LAN users can use TCP, and localhost users can use named pipes.
Apparently, this isn't doable. I suspect a service name conflict? Since the
service name is the fully qualified classname w/ namespace, do I create a
whole new service class for each scheme?
Some sample code below. Only works when I comment out all but the http bits.
Fails otherwise on tcpServiceHost.Open(); regarding the HTTP uri
http://localhost:8080/Bleah/Admin (weird?!).
---------------
internal static ServiceHost httpServiceHost = null;
internal static ServiceHost tcpServiceHost = null;
internal static ServiceHost pipeServiceHost = null;
internal static void StartService()
{
// Consider putting the baseAddress in the configuration system
// and getting it here with AppSettings
Uri baseAddress = new Uri("http://localhost:8080/Bleah/Admin");
// Instantiate new ServiceHost
httpServiceHost = new ServiceHost(typeof(AdminService), baseAddress);
httpServiceHost.Open();
// tcp service
// Consider putting the baseAddress in the configuration system
// and getting it here with AppSettings
baseAddress = new Uri("net.tcp://localhost:2062/Bleah/Admin");
tcpServiceHost = new ServiceHost(typeof(AdminService), baseAddress);
tcpServiceHost.Open();
// pipes service
// Consider putting the baseAddress in the configuration system
// and getting it here with AppSettings
baseAddress = new Uri("net.pipe://localhost/Bleah/Admin");
pipeServiceHost = new ServiceHost(typeof(AdminService), baseAddress);
pipeServiceHost.Open();
}
....
<service name="BleahAdminService" behaviorConfiguration="returnFaultsHttp">
<!--<endpoint contract="IMetadataExchange" binding="mexHttpBinding"
address="true" />-->
<endpoint contract="BleahIAdminService"
binding="wsHttpBinding"
address="http://localhost:8080/Bleah/Admin" />
<endpoint contract="BleahIAdminService"
binding="netTcpBinding"
address="net.tcp://localhost:2060/Bleah/Admin" />
<endpoint contract="BleahIAdminService"
binding="netNamedPipeBinding"
address="net.pipe://localhost/Bleah/Admin" />
</service>
Jon