locked
Hosting a WCF service inside a Windows service - what is the benefit? Workflow? RRS feed

  • Question

  • User853731431 posted

    So I was working through some sample projects to learn Workflow 4 and one was a WCF Workflow service.  One project I have coming up will involve creating a new windows service and I will also need to use workflow.  I was thinking this might be the way to go - have a wcf workflow service exposed through my windows service.  However, all I really need is to be able to execute one or more workflows from within the windows service.  Any application can execute a workflow, so if this is a new project, I dont see the need to have a wcf service.

    Just build the windows service and add the workflows and call them from within the service.

    Under what scenario would you want to build a wcf service to be hosted inside a windows service?

    Monday, May 13, 2013 8:09 AM

Answers

  • User-851967432 posted

    Ah, I need to get with times.

    The benefit is a self-hosting windows/wcf service with a listener to communicate the outside world. In the dark days befor wcf, we used named pipes and .net remoting to accomplish the same thing but were limited to the technologies and protocols. So a bigger benefit of this approach is the biggest benefit of wcf in that it allows communication between many different technolgies.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 13, 2013 8:50 AM

All replies

  • User-851967432 posted

    In no scenario would you want to do that and I'm doubting it's even possible.

    A windows service is buried deep in the OS in a layer that doesn't have access to outside resources or allow resources to get in. It's a self contained service by design.

    I'd suggest simply using the WCF as it's designed and forget about the windows service altogether.

    Monday, May 13, 2013 8:16 AM
  • User853731431 posted

    Well, the main reason I ask is after coming across this example

    http://msdn.microsoft.com/en-us/library/ms733069.aspx

    After seeing that, I was left wondering what the benefit would be?

    As I began figuring out what the best solution for my needs were, at first I thought about a WCF service, but in the end I went with a windows service to handle the tasks of runnin gon a schedule.  Another part of the process might be using a WCF service, but regardless I just couldnt see using WCF embeded in a windows service like in the above example.

    Yes, I agree WCF is probably best left to the role it was intended - a flexible service framework to handle requests.

    Monday, May 13, 2013 8:37 AM
  • User-851967432 posted

    Ah, I need to get with times.

    The benefit is a self-hosting windows/wcf service with a listener to communicate the outside world. In the dark days befor wcf, we used named pipes and .net remoting to accomplish the same thing but were limited to the technologies and protocols. So a bigger benefit of this approach is the biggest benefit of wcf in that it allows communication between many different technolgies.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 13, 2013 8:50 AM