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

E

Enzo Contini

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
 
T

Tony

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top