locked
Passing parameters at DSS service start RRS feed

  • Question

  • Hi All,

    I am trying to pass a parameter to a DSS service at its start. I want the parameter to be dynamic and also not from a XML file. I want to pass the parameter when the service is created. To be precise, every DSS service has a constructor that takes DsspServiceCreationPort as the argument. Can I somehow insert my own argument inside creationPort?

     public DssService(DsspServiceCreationPort creationPort)

    {

    }

    Thanks,

    Venkat

    Saturday, September 8, 2012 7:11 AM
    Moderator

Answers

  • I'm not aware of any way to do precisely what you are describing.

    Can you perhaps describe why you need this and what you are ultimately trying to accomplish.

    The usual way for providing configuration information to a service is through it's config file.  You could use an external program to programatically modify or generate the service's config file at runtime.  It will still be using an XML file "behind the scenes" but have the effect of making the service dynamically configurable.

    -G

    • Proposed as answer by Gershon Parent Monday, September 10, 2012 11:44 PM
    • Marked as answer by Venk KModerator Saturday, September 15, 2012 2:46 AM
    Monday, September 10, 2012 11:44 PM

All replies

  • I'm not aware of any way to do precisely what you are describing.

    Can you perhaps describe why you need this and what you are ultimately trying to accomplish.

    The usual way for providing configuration information to a service is through it's config file.  You could use an external program to programatically modify or generate the service's config file at runtime.  It will still be using an XML file "behind the scenes" but have the effect of making the service dynamically configurable.

    -G

    • Proposed as answer by Gershon Parent Monday, September 10, 2012 11:44 PM
    • Marked as answer by Venk KModerator Saturday, September 15, 2012 2:46 AM
    Monday, September 10, 2012 11:44 PM
  • Hi Gershon Parent,

    Thank you once again for the time and reply. I have a service that composes an object and I want to initialize the object when the service gets started and I want to pass a string to the constructor of this object. The string I would like to pass to the object is decided by the application that is creating the service and it is somewhat dynamic.

    Please let me know how to accomplish this in the best possible way.

    Thanks,

    Venkat

    Tuesday, September 11, 2012 6:41 PM
    Moderator
  • It might not be the only, or the best way, but I would use the file system...  have the creating service output either a proper .config file for the service that is being created, or a "command line" in a text file, and have the service that is being created/initialized process that file in its "Start()" method.

    -G

    Friday, September 14, 2012 9:41 PM
  • Thank you Gershon Parent for your advice. I will consider doing that.
    Friday, September 14, 2012 10:37 PM
    Moderator