Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. change webservice address at runtime?

change webservice address at runtime?

Scheduled Pinned Locked Moved C#
testingbeta-testingquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    visiontec
    wrote on last edited by
    #1

    hi there i made a webservice and then i added a web reference of it to my project Now is it possible to change JUST the webservice's ADDRESS at runtime?

    this.Url = "http://localhost/testing.asmx";

    I want to change the address of my WS in
    the reference.cs file at runtime

    And if it is, then can someone plz tell me how? some code might be nice! VisionTec

    H M 2 Replies Last reply
    0
    • V visiontec

      hi there i made a webservice and then i added a web reference of it to my project Now is it possible to change JUST the webservice's ADDRESS at runtime?

      this.Url = "http://localhost/testing.asmx";

      I want to change the address of my WS in
      the reference.cs file at runtime

      And if it is, then can someone plz tell me how? some code might be nice! VisionTec

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      You just did it yourself with that first line of code! :) Create an instance of your web service client proxy (which derives from WebClientProtocol) and set the Url property to whatever you need it to be.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      • V visiontec

        hi there i made a webservice and then i added a web reference of it to my project Now is it possible to change JUST the webservice's ADDRESS at runtime?

        this.Url = "http://localhost/testing.asmx";

        I want to change the address of my WS in
        the reference.cs file at runtime

        And if it is, then can someone plz tell me how? some code might be nice! VisionTec

        M Offline
        M Offline
        Mazdak
        wrote on last edited by
        #3

        And you can add a tag in your application setting file which indicate the url and at runtime read it. Mazy "Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups