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. Default Webservice URL

Default Webservice URL

Scheduled Pinned Locked Moved C#
questioncsharpvisual-studiosysadmin
2 Posts 2 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.
  • K Offline
    K Offline
    kmuthuk
    wrote on last edited by
    #1

    Hi I have created a webservice with a simple function HelloWorld. It works fine in the client application. How do I change the default url of the webservice that points to the asmx file? I know that I can change in Reference.cs in the client application. But I want to set the default url other than localhost to point to a server where my asmx file is. I am using VS 2003, C#. Thanks a lot in advance Muthu.

    E 1 Reply Last reply
    0
    • K kmuthuk

      Hi I have created a webservice with a simple function HelloWorld. It works fine in the client application. How do I change the default url of the webservice that points to the asmx file? I know that I can change in Reference.cs in the client application. But I want to set the default url other than localhost to point to a server where my asmx file is. I am using VS 2003, C#. Thanks a lot in advance Muthu.

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      Click the web reference you want to change. Look in the properties window and change the URL Behavior to Dynamic. This will create an entry in your app.config file (or web.config for web projects). This file can be modified before run time to point to the right place. Also, if you want to save hours of problems down the road change the Web Reference URL to an invalid URL in the properties panel and rely on the generated key. A sample app.config entry

      <add key="SimpleTest.localhost.Service1" value="http://localhost/testsite/Service1.asmx"/>


      File Not Found

      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