473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 5228
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...@yahoo.NoSpamMaam.comwrote:
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
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...
27
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...
39
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. ...
8
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...
5
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;...
1
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 =...
1
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...
7
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...
7
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.