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