Re: Conditional Web Service instantiation
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Tue, 28 Aug 2007 10:26:27 -0400
"John Beschler" <JohnBeschler@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D4C270F1-FA47-4802-9443-D633679E0762@xxxxxxxxxxxxxxxx
I work in a shop with up to three environments for the development/deployment
process. Each environment has its own db and web servers and its own web
services servers as well.
I am developing a .NET component as part of the application that calls one
of the web services for some of its functionailty. Currently, I have to
update the web service reference for the dev environment, compile the
component and deploy to the dev web server for testing/debug. Then, once the
code has been tested and debugged, before we can deploy it to the demo
environment I hate to change the URL for the web service, and recompile the
code to create a new install package for the demo environment. Then, for
changes and fixes, I have to change the web service URL back to the dev
environment and recompile the code and reinstall on the dev server.
If this was a windows app, I know we can control the web service url ion the
app.config file. However, my testing seems to indicate that does not work for
a component (DLL).
Is there some easier way to handle this so that I can code teh component
with both URLs and let it decide which webs service to call at runtime?
One way would be for the component to expose a Url property. This property could set the Url of the proxy class.
Another thing would be for the component to require a particular appSettings key in the .config file of the application that uses the component.
Finally, if you are using .NET 2.0, then I've heard that using the new Settings architecture will resolve this problem for you. In that case, the component itself would hold the definitions of the settings, along with their default values. If the setting existed in a config file, then it would be used, otherwise, it would be created when the component settings are persisted.
Caveat: I haven't tried this myself with a component.
--
John Saunders [MVP]
.
- Prev by Date: Re: System.Net.WebException: The request failed with HTTP status 4
- Next by Date: Re: SoapException problem
- Previous by thread: Re: System.Net.WebException: The request failed with HTTP status 4
- Next by thread: Re: Conditional Web Service instantiation
- Index(es):
Relevant Pages
|