none
Access Windows service from Web service using WCF RRS feed

  • Question

  • Hi,

     I have a password which should never save anywhere , once a windows service will start it get the password from the DB and delete permanently from DB. these service which maintains the password till the service is running.

    I had request from web service to get that password. Is it possible to get that password from windows services by a web service using WCF

    Thanks in Advance

    Thursday, April 3, 2014 4:44 AM

Answers

All replies


  • Can you help us, explaining your question with more details?

    What I understood is your windows service maintains the deleted password in-Memory and you wanted to expose that password to a web Service. If my understanding is correct- You have two options.

    Option-One: Using Inter process Communications. Refer:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx

    http://www.codeproject.com/Articles/19570/Inter-Process-Communication-with-C

    Here your windows service and web service required to be hosted on same computer.

    Option-Two: Host a WCF/.Net Remoting Service inside your Password maintained Windows Service

    Refer: http://msdn.microsoft.com/en-us/library/ms733069%28v=vs.110%29.aspx

    a conceptual view is as below:




    Lingaraj Mishra

    Thursday, April 3, 2014 5:17 AM
  • What i understood from you question is that you will be using hosting WCF using WindowService and you want to store the password in Memory.

    If you dont want the state to be persistent on disk, and somehow it should be  persistent in memory, so that if the service crashes (and auto restarts by Windows) it could pick up from where it left and go on

    For this you use Persitent Caching Block from the Microsoft Enterprise Library.

    Also you can host WCF Service in a Managed window service. In WindowService class OnStart Method it will fetch the Password from the database and store in the memory using Persistent Caching block.

    OnStop Method you can clear the cache block.

    Let me know if you need any further information.

    Thursday, April 3, 2014 6:10 AM
  • Thanks Mishra

    what you had understand is obsoletely correct. I will check with those link and update you soon. 

    Thursday, April 3, 2014 7:31 AM