'---------------------------------------------------------------- ' INTRODUCTION TO USING WEB SERVICES ' This Uses The "MathService" XML Web Service '---------------------------------------------------------------- 'Before writing any code, go to Project | Web Reference and add a refference to MathService. 'The Web reference Dialog allows you to search your machine or the net to find the service. It 'can be on any IIS machine in the world. 'Once a reference is made, you design the form the way you usually do. But instead of calling a local 'function/sub to do the math, you call the function in the web service application! Public Class WebForm1 Inherits System.Web.UI.Page Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click '---create new instance of webservice you made a reference to...Service1.wsdl Dim GetResult As New UsingWebService1.localhost.Service1 '---now use the function FROM within the webservice application to add numbers lblAnswer.Text = GetResult.AddIntegers(txtFirst.Text, txtSecond.Text) End Sub Private Sub btnSubtract_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubtract.Click '---create new instance of webservice Dim GetResult As New UsingWebService1.localhost.Service1 '---now use the function FROM within the webservice application to add numbers lblSub.Text = GetResult.SubtractIntegers(txtSub1.Text, txtSub2.Text) End Sub End Class