Re: Conditional Web Service instantiation



"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]

.



Relevant Pages

  • SoapException: unable to generate temporary class
    ... I have a Biztalk assembly that has been working great in my dev environment. ... the Web Service Publishing Wizard with great success. ... ping the WSDL on my production W2K3 server. ...
    (microsoft.public.biztalk.general)
  • Re: repost: Help with error "80070005"
    ... Have you tried running the SDK web service samples on your environment. ... The Messaging Engine failed to retrieve the configuration from the database. ...
    (microsoft.public.biztalk.general)
  • Re: RMM web service & web server(s)
    ... as a Enterprise ARchive for deployment under WAS. ... It requires a Java run-time and the WAS environment to get to the web service. ... I would not expect anyone to purchase WAS for the sole purpose of hosting our web service. ... Search the archives at http://bama.ua.edu/archives/ibm-main.html ...
    (bit.listserv.ibm-main)
  • RE: Help with my my Hello World web service
    ... set the UrlBehavior property to Dynamic. ... This will create an entry in the ... web.config file for your web service that you can edit. ... in code we get the url for the environment we're in: ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: WSE Settings 3.0 problems (Soap protocol factory)
    ... When starting a new Web Service project, if you use the "New Web Site" ... toolbar button instead of the "New Project" toolbar button, ... The reason for this is that after installing the WAP add-in or VS2005-SP1 ... For some reason the WAP settings disable the ability of the WSE 3 Settings ...
    (microsoft.public.dotnet.framework.webservices.enhancements)