Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Enzo Contini - 24 Oct 2006 13:22 GMT
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 - 28 Oct 2006 05:12 GMT
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

>I put my initialization code (ex. DataSource.ConnectionString definition
> etc...) in the public Service() method: diring a debug I noticed that that
[quoted text clipped - 6 lines]
> Thanks
> Enzo

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.