Windows Vista Forums

Unable to open IChannelListener
  1. #1


    Jon Davis Guest

    Unable to open IChannelListener

    Newbie 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 remote 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


      My System SpecsSystem Spec

  2. #2


    Nicholas Paldino [.NET/C# MVP] Guest

    Re: Unable to open IChannelListener

    Jon,

    You have defined one service with three endpoints, but you are trying to
    open the service host three times (and subsequently expose the same
    endpoints over again). You only need to open the service host once. Also,
    you don't need to set the base address, since you have full addresses in
    your config file.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard.caspershouse.com

    "Jon Davis" <jon@REMOVE.ME.PLEASE.jondavis.net> wrote in message
    news:um15reAmHHA.4872@TK2MSFTNGP03.phx.gbl...
    > 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
    >
    >
    >


      My System SpecsSystem Spec

  3. #3


    Jon Davis Guest

    Re: Unable to open IChannelListener

    I played with this for two or three hours yesterday. I realized what you are
    saying, but doing it as you described (open it once, without a base address
    in the constructor, but leave the base addresses in the config file), the
    listeners were NOT active.

    Jon

    "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
    message news:2F2102D0-9837-428A-89E0-D80414529662@microsoft.com...
    > Jon,
    >
    > You have defined one service with three endpoints, but you are trying
    > to open the service host three times (and subsequently expose the same
    > endpoints over again). You only need to open the service host once.
    > Also, you don't need to set the base address, since you have full
    > addresses in your config file.
    >
    >
    > --
    > - Nicholas Paldino [.NET/C# MVP]
    > - mvp@spam.guard.caspershouse.com
    >
    > "Jon Davis" <jon@REMOVE.ME.PLEASE.jondavis.net> wrote in message
    > news:um15reAmHHA.4872@TK2MSFTNGP03.phx.gbl...
    >> 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
    >>
    >>
    >>

    >



      My System SpecsSystem Spec

  4. #4


    Jon Davis Guest

    Re: Unable to open IChannelListener

    I seem to have gotten it to work. A good night of sleep, attention to
    absolute URIs, and knowing I'm on the right track (i.e. using the config
    file solely) and I'm good to go.

    Jon


    "Jon Davis" <jon@REMOVE.ME.PLEASE.jondavis.net> wrote in message
    news:e0E3x$JmHHA.3996@TK2MSFTNGP06.phx.gbl...
    >I played with this for two or three hours yesterday. I realized what you
    >are saying, but doing it as you described (open it once, without a base
    >address in the constructor, but leave the base addresses in the config
    >file), the listeners were NOT active.
    >
    > Jon
    >
    > "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
    > in message news:2F2102D0-9837-428A-89E0-D80414529662@microsoft.com...
    >> Jon,
    >>
    >> You have defined one service with three endpoints, but you are trying
    >> to open the service host three times (and subsequently expose the same
    >> endpoints over again). You only need to open the service host once.
    >> Also, you don't need to set the base address, since you have full
    >> addresses in your config file.
    >>
    >>
    >> --
    >> - Nicholas Paldino [.NET/C# MVP]
    >> - mvp@spam.guard.caspershouse.com
    >>
    >> "Jon Davis" <jon@REMOVE.ME.PLEASE.jondavis.net> wrote in message
    >> news:um15reAmHHA.4872@TK2MSFTNGP03.phx.gbl...
    >>> 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
    >>>
    >>>
    >>>

    >>

    >
    >



      My System SpecsSystem Spec

  5. #5


    keimpema@gmail.com Guest

    Re: Unable to open IChannelListener

    On 17 mei, 18:41, "Jon Davis" <j...@REMOVE.ME.PLEASE.jondavis.net>
    wrote:
    > I seem to have gotten it to work. A good night of sleep, attention to
    > absolute URIs, and knowing I'm on the right track (i.e. using the config
    > file solely) and I'm good to go.
    >
    > Jon
    >
    > "Jon Davis" <j...@REMOVE.ME.PLEASE.jondavis.net> wrote in message
    >
    > news:e0E3x$JmHHA.3996@TK2MSFTNGP06.phx.gbl...
    >
    > >I played with this for two or three hours yesterday. I realized what you
    > >are saying, but doing it as you described (openit once, without a base
    > >address in the constructor, but leave the base addresses in the config
    > >file), the listeners were NOT active.

    >
    > > Jon

    >
    > > "Nicholas Paldino [.NET/C# MVP]" <m...@spam.guard.caspershouse.com> wrote
    > > in messagenews:2F2102D0-9837-428A-89E0-D80414529662@microsoft.com...
    > >> Jon,

    >
    > >> You have defined one service with three endpoints, but you are trying
    > >> toopenthe service host three times (and subsequently expose the same
    > >> endpoints over again). You only need toopenthe service host once.
    > >> Also, you don't need to set the base address, since you have full
    > >> addresses in your config file.

    >
    > >> --
    > >> - Nicholas Paldino [.NET/C# MVP]
    > >> - m...@spam.guard.caspershouse.com

    >
    > >> "Jon Davis" <j...@REMOVE.ME.PLEASE.jondavis.net> wrote in message
    > >>news:um15reAmHHA.4872@TK2MSFTNGP03.phx.gbl...
    > >>> Newbie to WCF here. I am getting the error "unabletoopenits
    > >>>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


    Hi,

    Would you please shared your solution (code + config) with this group?
    I am struggling with a similar problem.

    Harmen

      My System SpecsSystem Spec

Unable to open IChannelListener problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open a .doc schumbley@btopenworld.com Vista General 4 09 Nov 2009
Unable to Open pic iMiSsEdViStA Vista music pictures video 1 20 Oct 2008
Unable to open avi's, mpg's or wmv's bgjon56 Vista mail 3 03 Jun 2007
unable to open avi's, mpg's or wmv's bgjon56 Vista mail 4 31 May 2007
unable to open avi's, mpg's or wmv's bgjon56 Vista mail 0 30 May 2007