php如何调用webservice应用介绍(6)

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string selectFlag = selectOper.Value;
        localhost.Service web = new localhost.Service();
        if (selectFlag.Equals("+"))
        {
            Result.Text =(web.addition(double.Parse(Num1.Text),double.Parse(Num2.Text))).ToString();
        }
        else if (selectFlag.Equals("-"))
        {
            Result.Text = (web.subtract(double.Parse(Num1.Text), double.Parse(Num2.Text))).ToString();
        }
        else if (selectFlag.Equals("*"))
        {
            Result.Text = (web.multiplication(double.Parse(Num1.Text), double.Parse(Num2.Text))).ToString();
        }
        else if (selectFlag.Equals("https://www.jb51.net/"))
        {
            Result.Text = (web.division(double.Parse(Num1.Text), double.Parse(Num2.Text))).ToString();
        }
    }
}


 

到此一个一个简单的WebService的开发和调用就已经完成了,在实际应用中可以根据自己的需要,写一些功能强大的,复杂的WebService,不管多么复杂,整个流程都是这样的。

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2f197a4c9bd260908838550fd14e3745.html