dynamically change web service URL based on environment

Discussion in 'ASP .Net' started by steven, Dec 12, 2007.

  1. steven

    steven Guest

    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.
    steven, Dec 12, 2007
    #1
    1. Advertising

  2. 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.
    >
    Peter Bromberg [C# MVP], Dec 12, 2007
    #2
    1. Advertising

  3. steven

    steven Guest

    On Dec 12, 10:34 am, Peter Bromberg [C# MVP]
    <> wrote:
    > 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 -
    steven, Dec 12, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kit

    Dynamically change URL in Web Service

    kit, Apr 22, 2004, in forum: ASP .Net Web Services
    Replies:
    4
    Views:
    157
  2. Gujju

    Change URL of Web service at Runtime

    Gujju, May 30, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    122
    Gujju
    May 30, 2005
  3. Gujju

    Change url of web service at runtime

    Gujju, May 30, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    171
    Chris Hayes
    May 31, 2005
  4. change web service URL at runtime

    , Jul 6, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    153
    Vijay Pandey
    Jul 7, 2006
  5. 'Layemi Oshodi

    Dynamically change web service path

    'Layemi Oshodi, Apr 20, 2010, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    935
    sdunnin
    Apr 21, 2010
Loading...

Share This Page