A simple Web Service Application Example

Source: Internet
Author: User
1. First we find a web service provided by someone else online, this example uses http://www.ayandy.com/Service.asmx
2. Use vs2005 to create an Asp.net website, right-click the project, select "add web reference" from the menu, enter the Web service address in the URL, and click "add ".
3. Create an Asp.net page, add a text box and a button, double-click the button and enter the following Code Com. ayandy. www. Service myservice =   New Com. ayandy. www. Service ();
Com. ayandy. www. thedayflagenum day = Com. ayandy. www. thedayflagenum. today;
String [] Weather = Myservice. getweatherbycityname (textbox1.text, Day );
Foreach ( String Weatherdetail In Weather)
{
Response. Write (weatherdetail );
}

4. RunProgram, OK, success

Hope to be useful to new users :)

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.