Asp.net 2.0 how to set dynamic addresses referenced by web Services

Source: Internet
Author: User

It is easy to add web service references in 2.0. But how do I set the web service address during release and installation?

In winform, set the reference to dynamic (dynamic) reference. vs automatically adds a configuration in app. config, and changes the address in this configuration. However, this configuration menu cannot be found in the asp. net2.0 project.

I checked some information and found it in asp.net.
Specific configuration methods are found on the website.

Suppose we have introduced a webservice named myService, which contains a class of WebService.

Method 1: You can specify the web service address in the program.

For example:

MyService. WebService service = new
MyService. WebService ();

Service. url = "http: // localhost/myservice/webservice. asmx ";

......

 

Method 2: Configure web. config directly

In
Add the following section to the appseeting configuration section:

<Add name = "myService. WebService"
Value = "http: // localhost/myservice/webservice. asmx"/>

It's that simple.

Here is an english blog can refer to the http://weblogs.asp.net/bradleyb/archive/2006/05/04/445133.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.