Call a function in a windows service from a web service

Posted on 2005-04-25
Last Modified: 2010-05-18
I have a windows service that contains a function I want to call from my web service.  I have a web service -> Business Logic Layer -> Data Access Layer.  I want to call the windows service function from my Business logic layer.  Any help on how to do this would be great.  I am writing in

Question by:imsolost
    LVL 7

    Accepted Solution

    In the windows service, you can override a method called OnCustomCommand.  It takes an integer.  Then, via the System.ServiceProcess.ServiceController you can call the ExecuteCommand method with an integer parameter.  These integers match up...

    You can then in your service code perform some operations.

    Good Luck,
    LVL 7

    Author Comment

    Thanks for your reply.  Do you have an example that you could show me?  
    LVL 7

    Expert Comment

    I have done it before...don't really have any examples I can send you.  It is not too hard.

    Check out this seems to have an example you can download.

    LVL 3

    Expert Comment

    try Remoting

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Flash ( has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now