Ent. Lib. 4.1 in Web Service

Topics: Enterprise Library Core, General discussion
Mar 27, 2009 at 7:29 AM
i've done Ent Lib in Windows Application using Class Library, now i would like to migrate it to use Web Services

can i do something like that?

any insight?

thanks,
erick


Mar 27, 2009 at 9:32 AM
Hi,

AFAIK, yes you can use Ent Lib in a Web Service. It seems to be the same as using it in a regular Windows or ASP.NET application. I have tried using Logging, Caching and Exception Handling on a Web Service and it seems the same. 


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Mar 27, 2009 at 9:39 AM
thanks Valiant Dudan

hm..i'm just thinking where to put the app.config file..is it suppose to be in app_data folder WebServices? then we all set up?

thanks,
erick

Mar 27, 2009 at 9:51 AM
Are you talking about the web.config of the web service? if that is the case, i just leave it as ease where it is defaulted by the project and everything seems fine. 

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Mar 27, 2009 at 10:03 AM
App.config where we used to set Connection to DB, Rules, Logging, etc...
(Security App block, Logging block, etc)

isn't that Ent. Lib need these file?


Mar 27, 2009 at 12:44 PM
So you are using external config files rather than one config alone. IMHO, i think it would be better if all the config are in the same location as my web.config.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Mar 31, 2009 at 1:37 AM
thanks Valiant Dudan

So you are using external config files rather than one config alone -> hm, i think i make a mistake all this time..

correct me if i'm wrong

from ent. lib 3.0..i always use file that calls app.config..there's is this file to when i see Ent. Lib. Quickstarts guide..so that's why i always use this file..
from what u saying it didn't have to use app.config..i only need web.config file..:(

if i develop Desktop Application, i can use web.config too?
how Ent. Lib Block (Security App Block, etc) check the config file in my application??

PS: sorry for silly questions..i think u understand ent. lib..but now it turn out otherwise

thanks,
erick




Mar 31, 2009 at 5:26 AM
Usually, when you create a web applications (ASP.NET application, Web Service, etc.) it comes with a web config by default. So, I may say yes, if you are creating a web based application, all you need is a web.config. You can put all your Ent Lib configuration in that web.config, or you have the option to put the ent lib config to the external config files. As dicussed in this: http://blogs.msdn.com/tomholl/archive/2006/04/02/entlib2externalconfig.aspx ,. Desktop application uses app.config since they are not web based. As far as I know, Ent lib reads the configuration on the app.config or web.config and use it together with the internal implementations of the ent lib blocks. 


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com