Where I can put initialization code in a .Net Web Service?

Discussion in 'ASP .Net Web Services' started by Enzo Contini, Oct 24, 2006.

  1. Enzo Contini

    Enzo Contini Guest

    I put my initialization code (ex. DataSource.ConnectionString definition
    etc...) in the public Service() method: diring a debug I noticed that that
    method is called at every call of a WebMethod so now I think that that is not
    the "right" place where to put any initialization ... but where is the right
    metghod that perhaps I need to overload?

    Thanks
    Enzo
    Enzo Contini, Oct 24, 2006
    #1
    1. Advertising

  2. Enzo Contini

    Tony Guest

    I create a different static class to hold on to things. The web methods can
    reference static methods and properties on the static class to get
    information such as connection strings and other state information you want
    to hold onto.

    Tony

    "Enzo Contini" <Enzo > wrote in message
    news:...
    >I put my initialization code (ex. DataSource.ConnectionString definition
    > etc...) in the public Service() method: diring a debug I noticed that that
    > method is called at every call of a WebMethod so now I think that that is
    > not
    > the "right" place where to put any initialization ... but where is the
    > right
    > metghod that perhaps I need to overload?
    >
    > Thanks
    > Enzo
    Tony, Oct 28, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JKop
    Replies:
    10
    Views:
    913
  2. Eric
    Replies:
    0
    Views:
    431
  3. Matthias Kaeppler
    Replies:
    2
    Views:
    414
    Victor Bazarov
    Jul 18, 2005
  4. Replies:
    6
    Views:
    443
    Ron Natalie
    Dec 11, 2005
  5. Leo Violette
    Replies:
    0
    Views:
    993
    Leo Violette
    Apr 17, 2009
Loading...

Share This Page