I have a bunch of web services that are used to return data. All of the
methods access a DB to get the data. Ideally I would like to have them
inherit from a base class that takes care of the DB connection and
exception logging.
By default in VS.NET all web service classes inherit from
System.Web.Services.WebService. My understanding is that the main
benefit of this is you get access to the Application and Session
objects. But a web service does not need to inherit from this class to
work. VS.NET generates code that overrides the Dispose method of this
inhertited class so I can not even compile without inheriting.
So as I see it I could
A) Figure out how to make my web service classes work without
inheriting from System.Web.Services.WebService and then inherit from a
base class that takes care of DB connections and logging.
B) Use Microsoft's Data Access Application Block to take care of DB
connection and paramter caching and find another way to deal with
logging.
Anyone have any recommendations? Is there another way to do this? How
can I achieve A)
Thanks in advance,
Rupert