How do I dynamically set a Web Service reference at runtime

Discussion in 'ASP .Net Web Services' started by Ray Stevens, Jan 10, 2006.

  1. Ray Stevens

    Ray Stevens Guest

    I added a web service reference to my project that is pointing at a
    development web service. I want to change this to point to a staging server,
    etc. via a config file reference rather than hardcode it into the compile.
    How do I do this?
    Ray Stevens, Jan 10, 2006
    #1
    1. Advertising

  2. Ray Stevens

    Josh Twist Guest

    MyService myService = new MyService();
    myService.Url = "http://myendpoint.com/service.asmx"; // you probably
    want to read this from config.

    Josh
    http://www.thejoyofcode.com/
    Josh Twist, Jan 11, 2006
    #2
    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. kennymce
    Replies:
    3
    Views:
    607
    nick chan
    Jul 3, 2008
  2. Phoenix
    Replies:
    2
    Views:
    230
    Teemu Keiski
    Jun 6, 2005
  3. Andrew Crossley

    Creating User Controls Dynamically - Object Reference Not Set erro

    Andrew Crossley, Nov 7, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    151
    Andrew Crossley
    Nov 7, 2005
  4. Peter Stojkovic
    Replies:
    0
    Views:
    468
    Peter Stojkovic
    Mar 30, 2006
  5. Leo Violette
    Replies:
    0
    Views:
    1,000
    Leo Violette
    Apr 17, 2009
Loading...

Share This Page