C # Call webservice (1 ),

Source: Internet
Author: User

C # Call webservice (1 ),

I have been engaged in network programming recently. This article is about webservice. I am going to write two examples.
This article describes how to query the destination location of the mobile phone number and how to query the ticket in the next article.

This website (http://www.webxml.com.cn/zh_cn/index.aspx) provides several free web Services. The following is the result: (including C # webservice (2) some code is as follows:
 1 private void button1_Click(object sender, EventArgs e) 2         { 3             ServiceReference1.MobileCodeWSSoapClient ww = new ServiceReference1.MobileCodeWSSoapClient("MobileCodeWSSoap"); 4             label1.Text = ww.getMobileCodeInfo(textBox1.Text,""); 5         } 6  7         private void button2_Click(object sender, EventArgs e) 8         { 9             ServiceReference1.MobileCodeWSSoapClient ww = new ServiceReference1.MobileCodeWSSoapClient("MobileCodeWSSoap");10             string[] s = new string[1000];11             s = ww.getDatabaseInfo();12             for (int i = 0; i < 361; i++)13             {14                 listBox1.Items.Add(s[i]);15             }16         }

The web service called: http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx
There are two functions: getMobileCodeInfo () getDatabaseInfo ()
For how to use functions, see the case

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.