-
October 4th, 2005, 08:17 PM
#1
web services and web.config
Hey guys,
Question about configuration for web services. I have a web.config, with an "appSettings" section and some key/value pairs for basic configuration of my web service. But, when I use ConfigurationSettings.AppSettings["key"], it is looking at the app.config of the application calling the web service. This makes sense to me, but my question is - what is the best way to store and access configuration information that is general to the web service? Even somewhere where I can put a filepath in that points to a confugration file would be satisfactory.
I checked something one of our other programmers did to configure a web service, and they had hard coded the path to an XML file into the web service and included a nice comment "config.xml should reside in the application path...".
-
October 4th, 2005, 09:13 PM
#2
Re: web services and web.config
If you're using ASP.NET Web Service, you should use the web.config file residing where you web application was deployed. The ConfigurationSettings.AppSettings should work fine in that case.
Originally Posted by Zeb
Hey guys,
Question about configuration for web services. I have a web.config, with an "appSettings" section and some key/value pairs for basic configuration of my web service. But, when I use ConfigurationSettings.AppSettings["key"], it is looking at the app.config of the application calling the web service. This makes sense to me, but my question is - what is the best way to store and access configuration information that is general to the web service? Even somewhere where I can put a filepath in that points to a confugration file would be satisfactory.
I checked something one of our other programmers did to configure a web service, and they had hard coded the path to an XML file into the web service and included a nice comment "config.xml should reside in the application path...".
-
October 4th, 2005, 09:19 PM
#3
Re: web services and web.config
So that should work... ok. It is probably because my test harness application is in the same solution as the web service (even though i reference the localhost webservice, not the webservice project). I'll run with this, and just leave the config I require in both the app.config for my test harness and the web.config for when it is deployed while I am still debugging.
Thanks Igor.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|