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. Advertisements

  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. Advertisements

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. Amil
    Replies:
    5
    Views:
    3,322
    sirfunusa
    Mar 30, 2006
  2. hocho888
    Replies:
    1
    Views:
    871
  3. =?Utf-8?B?c2h5YW0=?=
    Replies:
    2
    Views:
    849
    =?Utf-8?B?c2h5YW0=?=
    May 22, 2006
  4. Eric
    Replies:
    0
    Views:
    485
  5. Guest
    Replies:
    4
    Views:
    500
    John Saunders [MVP]
    Jun 23, 2007
  6. Amil

    Can .net 1.1 call asp.net 2.0 web service

    Amil, Mar 30, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    164
    Josh Twist
    Mar 31, 2006
  7. Leo Violette
    Replies:
    0
    Views:
    1,302
    Leo Violette
    Apr 17, 2009
  8. jazzydance

    asp.net web service connecting to another web service

    jazzydance, Feb 7, 2010, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    1,026
    Mr. Arnold
    Feb 8, 2010
Loading...