Then write the Windows client and Web client to consume the service.

Source: Internet
Author: User

In order to reflect the characteristics of XMLWebService, such as cross-heterogeneous platforms, system-independent, device-independent, and consumer application types.
The following example shows how to use C # To write a Windows program to consume the service:
The code is simple, just add the following lines:
Private void button#click (object sender, System. EventArgs e)
{
Get. Service1 AA = new WS03.Get. Service1 ();
String score = AA. GetScore (comboBox1.SelectedItem. ToString (), comboBox2.SelectedItem. ToString (). ToString ();
Label3.Text = "student" + comboBox1.SelectedItem. ToString () + "+ comboBox2.SelectedItem. ToString () +" score: "+ score;
}
Private void button2_Click (object sender, System. EventArgs e)
{
Get. Service1 AA = new WS03.Get. Service1 ();
String average = AA. GetAverage (comboBox1.SelectedItem. ToString (). ToString ();
Label4.Text = "student" + comboBox1.SelectedItem. ToString () + "average score:" + average;
}
Private void button3_Click (object sender, System. EventArgs e)
{
Get. Service1 AA = new WS03.Get. Service1 ();
String order = AA. GetOrder (comboBox1.SelectedItem. ToString (). ToString ();
Label5.Text = "student" + comboBox1.SelectedItem. ToString () + "ranking:" + order + "name ";
}
Then, use VB. NET to compile an ASP. NET program to call the service:
The Code is also very simple:
Private Sub button#click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button1.Click
Dim AA As New [Get]. Service1
Label1.Text = AA. GetScore (DropDownList1.SelectedItem. Text, DropDownList2.SelectedItem. Text)
End Sub

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.