473,703 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamically change web service URL based on environment

hi

as many web developers do, i sniff the URL of my app and toggle things
like the db connection string, default email recipients, etc
dynamically based on what i find (ie. dev.mysite.com, qa.mysite.com,
mysite.com). this way, i don't have to worry about updating my
web.config file everytime i want to deploy my app from DEV to QA to
PRODUCTION. however, there doesn't seem to be a way to do this with
the web service URL property in VS. i can set the URL property for my
web services to dynamic, but this just means the URL will be loaded
from the web.config file. this means i'm having to maintain separate
web.config files for my three hosting environments.

has anybody got a more elegant way of toggling the web service URL
based on the environment their site is running under?

tks.
Dec 12 '07 #1
2 5249
the Webservice client proxy class generated by a WebReference has a Url
properrty that you can set.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"steven" wrote:
hi

as many web developers do, i sniff the URL of my app and toggle things
like the db connection string, default email recipients, etc
dynamically based on what i find (ie. dev.mysite.com, qa.mysite.com,
mysite.com). this way, i don't have to worry about updating my
web.config file everytime i want to deploy my app from DEV to QA to
PRODUCTION. however, there doesn't seem to be a way to do this with
the web service URL property in VS. i can set the URL property for my
web services to dynamic, but this just means the URL will be loaded
from the web.config file. this means i'm having to maintain separate
web.config files for my three hosting environments.

has anybody got a more elegant way of toggling the web service URL
based on the environment their site is running under?

tks.
Dec 12 '07 #2
On Dec 12, 10:34 am, Peter Bromberg [C# MVP]
<pbromb...@yaho o.NoSpamMaam.co mwrote:
the Webservice client proxy class generated by a WebReference has a Url
properrty that you can set.
exactly what i was looking for. tks.
-- Peter
Site:http://www.eggheadcafe.com
UnBlog:http://petesbloggerama.blogspot.com
MetaFinder:http://www.blogmetafinder.com

"steven" wrote:
hi
as many web developers do, i sniff the URL of my app and toggle things
like the db connection string, default email recipients, etc
dynamically based on what i find (ie. dev.mysite.com, qa.mysite.com,
mysite.com). this way, i don't have to worry about updating my
web.config file everytime i want to deploy my app from DEV to QA to
PRODUCTION. however, there doesn't seem to be a way to do this with
the web service URL property in VS. i can set the URL property for my
web services to dynamic, but this just means the URL will be loaded
from the web.config file. this means i'm having to maintain separate
web.config files for my three hosting environments.
has anybody got a more elegant way of toggling the web service URL
based on the environment their site is running under?
tks.- Hide quoted text -

- Show quoted text -
Dec 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2984
by: lanky_tx | last post by:
Hi All, We have an automated build and test environment using NAnt and Nunit. Some of our assemblies are being strong named by modifying the AssemblyInfo.cs and having csc compile it. Some of these strong named assemblies are being dynamically loaded into the runtime. We store the metadata information about the strong named assemblies in a config file. Metadata in the config file looks like this:
27
4743
by: Nicholas Couch | last post by:
I have a little form with a couple of dynamically generated list boxes. When the user makes a selection from the first box, the second box is refreshed. When they make a selection from the second box, I concatenate the selections from the two boxes and add the string to a list at the top of the form, using createElement and appendChild. The list is actually a bunch of span elements contained within a div. Each span element includes a small...
39
6535
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. When it completes, it can call a success, or a failure function. The names of these success, or failure functions will differ, and I'd like to know how I can pass the name of a function to my tool, and how my tool can call the function, using that...
8
1516
by: Nils Magnus Englund | last post by:
Hi, I have a production, test and development environment for my web application and a web service (The test web application connects to the test web service, and so on). Is it possible to let the web services location be set in e.g. Web.config? I don't want to recompile the web application every time I move it to another environment, nor do I want the code to be much more complicated than with a hardcoded location. The web service...
5
3515
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator; Response.Form.GetEnumerator(), etc. while, identifying specific controls by programmatically assigned unique id (e.g. MyButton_AnswerID_123). However, I am not sure if that is the proper way. What is the common practice?
1
1836
by: Ed Chiu | last post by:
Hi, Is there a way to set webform controls to visible/invisible dynamically. Say I have a textbox cann txtFirstName, I know the following statement can set it visible: txtFirstName.visible = true Here is difficult part, I am tring to set the controls visible based on the content of DataReader or DataSet. If the datareader has a row that has an
1
1616
by: RM82 | last post by:
Hi All, I am not sure if this approach is feasible. But i have a timesheets application that works for several small organisations. One of the companies has a small office in South Africa and cant access the system remotly due to poor Intenet connections. I need to implement local DBs and distibute the application locally on machines, so in what essentially i will be doing is running a local version of my application on these...
7
10063
by: Steve_Black | last post by:
Hello, I'm toying with the idea of loading a MenuStrip (VB.Net 2005) dynamically based on who is logged into my system. Every user has different security settings and I want to customize the main menu instead of showing all possible options and only enabling/disabling certain ones. I have a table that stores the menu item name, parent item (if applicable), display order, etc. so that I can dynamically load my
7
6656
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: http://www.asp.net/learn/ajax-videos/video-156.aspx (3rd comment - Joe Stagner)
0
8739
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9089
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8941
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5910
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4412
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2406
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2037
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.