Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to call a method from a running service?

How to call a method from a running service?

Scheduled Pinned Locked Moved C#
tutorialquestioncsharpwcf
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    s196675m
    wrote on last edited by
    #1

    Windows has many services running. How can I call a method from a particular service from my application. Suppose Service name "ftpsvc" is running. From my aplication I want to call a method of ftpsvc service to see the return value. I have some idea about Remoting, WCF. Any example code or pointing to the right direction will be helpful. thank you.

    RaviBeeR 1 Reply Last reply
    0
    • S s196675m

      Windows has many services running. How can I call a method from a particular service from my application. Suppose Service name "ftpsvc" is running. From my aplication I want to call a method of ftpsvc service to see the return value. I have some idea about Remoting, WCF. Any example code or pointing to the right direction will be helpful. thank you.

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      I think you may be confusing a Windows service with a web service.

      • A Windows service is an app that can be configured to start when the Windows starts and runs in the background as long as Windows is running. IOW, a user isn't required to be logged on in order to run the app.
      • A web service is an API that can be accessed over the network. A WCF web service is hosted in a service host, which is usually IIS, a Windows service, or a Windows or console app.

      /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      S 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        I think you may be confusing a Windows service with a web service.

        • A Windows service is an app that can be configured to start when the Windows starts and runs in the background as long as Windows is running. IOW, a user isn't required to be logged on in order to run the app.
        • A web service is an API that can be accessed over the network. A WCF web service is hosted in a service host, which is usually IIS, a Windows service, or a Windows or console app.

        /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        S Offline
        S Offline
        s196675m
        wrote on last edited by
        #3

        Hi Thank you for your reply. My question is not about the type of services. I have a windows service running and suppose it has a Method (contract) called GetTime(). From another service or application,how can I call GetMethod() of the other running windows service. Thank you

        RaviBeeR 1 Reply Last reply
        0
        • S s196675m

          Hi Thank you for your reply. My question is not about the type of services. I have a windows service running and suppose it has a Method (contract) called GetTime(). From another service or application,how can I call GetMethod() of the other running windows service. Thank you

          RaviBeeR Offline
          RaviBeeR Offline
          RaviBee
          wrote on last edited by
          #4

          s196675m wrote:

          I have a windows service running and suppose it has a Method (contract) called GetTime().

          Just to confirm I understand you, your Windows service has a ServiceHost that hosts the WCF service that has the GetTime() operation contract, right? If so, just add a reference to the WCF service (make sure it's running) in your client app. You can do this through the IDE or generate the reference (i.e. the client proxy) manually using svcutil.exe. Then, just call the proxy's GetTime() method. /ravi

          My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups