locked
WCF Generic Duplex Service DLL RRS feed

  • Question

  • I am trying to write a duplex WCF service - client as an encapsulated dll. I have only found 1 small example of a simple client as dll on codeproject. I am using NetTcpBinding. And the client is DuplexClientBase<T>.  I am configuring the WCF service and client in code - no app.config files with xml ..

    I am using a subscribe-publish model for the service contract.

    I would like to be able to do something like this in my Windows Service,

    static ServiceHost<ServiceContract, ClientCallback> {get; set;}

    onStart(){

    SvcHost = new ServiceHost<TContract, TCallback>();
    SvcHost.Open();
    }

    OnSomeEvent(MyEventArgs e) { SvcHost.SendCallbackInfo(e);}

    How can I do this ? Some code examples would be greatly appreciated.


    When you think there is no way, there is a loophole. When you have made it idiot proof, they come out with a better idiot.

    Monday, September 28, 2015 2:31 PM

Answers

  • Hi Stixoffire,

    There is no difference to start WCF Client from a Windows Service. You can also write the client code in a OnStart() event, as you did for service's code. But you need to aware that client needs to wait service started up.

    • Marked as answer by Grady_Dong Friday, October 9, 2015 2:22 AM
    Friday, October 2, 2015 9:58 AM

All replies

  • Hi Stixoffire,
    I am trying to involve someone familiar with this topic to further look at this issue.
    There might be some time delay. Appreciate your patience.

    Best Regards,

    Grady

    Wednesday, September 30, 2015 2:24 AM
  • Hi Stixoffire,

    There is no difference to start WCF Client from a Windows Service. You can also write the client code in a OnStart() event, as you did for service's code. But you need to aware that client needs to wait service started up.

    • Marked as answer by Grady_Dong Friday, October 9, 2015 2:22 AM
    Friday, October 2, 2015 9:58 AM