How to dynamically configure a webservice address?

Discussion in 'ASP .Net Web Services' started by John Dow, Nov 26, 2007.

  1. John Dow

    John Dow Guest

    I have an ASP.Net project, in which I added a web reference, for example
    http://Sandbox/service.asmx
    after I pass the testing, I want to change the web service address to
    http://Production/service/asmx, which has the exactly same interface as the
    sandbox.

    My question is how to dynamically configure the ASP.Net application point to
    the right web service address after I deploy the code from test to
    production enviroment without recompile the code?
    Anyone can point me to the right direction how to solve this issue? Thanks
    John Dow, Nov 26, 2007
    #1
    1. Advertising

  2. In the properties for the web service reference is a "Static | Dynamic"
    option. I don't remember the actual property name, but as there are only a
    half dozen properties, it's easy to find.

    If you switch it to "Dynamic", it'll pull the URL out of the web.config
    file. You can then have a different config file for production / dev / test
    / staging.

    --
    Chris Mullins

    "John Dow" <> wrote in message
    news:...
    >I have an ASP.Net project, in which I added a web reference, for example
    > http://Sandbox/service.asmx
    > after I pass the testing, I want to change the web service address to
    > http://Production/service/asmx, which has the exactly same interface as
    > the
    > sandbox.
    >
    > My question is how to dynamically configure the ASP.Net application point
    > to
    > the right web service address after I deploy the code from test to
    > production enviroment without recompile the code?
    > Anyone can point me to the right direction how to solve this issue?
    > Thanks
    >
    >
    >
    >
    Chris Mullins [MVP - C#], Nov 26, 2007
    #2
    1. Advertising

  3. John Dow

    John Dow Guest

    Thanks, works like a charm!


    "Chris Mullins [MVP - C#]" <> wrote in message
    news:...
    > In the properties for the web service reference is a "Static | Dynamic"
    > option. I don't remember the actual property name, but as there are only a
    > half dozen properties, it's easy to find.
    >
    > If you switch it to "Dynamic", it'll pull the URL out of the web.config
    > file. You can then have a different config file for production / dev /
    > test / staging.
    >
    > --
    > Chris Mullins
    >
    > "John Dow" <> wrote in message
    > news:...
    >>I have an ASP.Net project, in which I added a web reference, for example
    >> http://Sandbox/service.asmx
    >> after I pass the testing, I want to change the web service address to
    >> http://Production/service/asmx, which has the exactly same interface as
    >> the
    >> sandbox.
    >>
    >> My question is how to dynamically configure the ASP.Net application point
    >> to
    >> the right web service address after I deploy the code from test to
    >> production enviroment without recompile the code?
    >> Anyone can point me to the right direction how to solve this issue?
    >> Thanks
    >>
    >>
    >>
    >>

    >
    >
    John Dow, Nov 27, 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. avnrao
    Replies:
    1
    Views:
    7,197
    avnrao
    May 4, 2004
  2. Patrice
    Replies:
    0
    Views:
    869
    Patrice
    May 4, 2004
  3. Raterus
    Replies:
    0
    Views:
    419
    Raterus
    Jun 2, 2004
  4. HS1
    Replies:
    0
    Views:
    438
  5. Lars-Erik
    Replies:
    5
    Views:
    3,245
    Steven Cheng [MSFT]
    Jun 24, 2008
Loading...

Share This Page