|
The ProgrammingMSAccess.COM Site This procedure demonstrates how to INVOKE THE SSSWSDemo SERVICE with A wEB REFERENCE NAME OF CABLAT. The Ten_most_expensive_products web method returns an xml object, and the procedure parses the document to display all the child nodes without tags from the returned xml document. Private Sub Button3_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles Button3.Click
Dim xws1 As New cablat1.SSSWSDemo Dim response As New Object Dim result As System.Xml.XmlElement
'Populate object and pass to 'XmlElement variableresponse = _ xws1.Ten_Most_Expensive_Products result = response(0)
'Save resultset in XmlDocument Dim xdc1 As New System.Xml.XmlDocument
'Extract root node from XmlDocument xdc1.LoadXml(result.OuterXml) Dim root As System.Xml.XmlNode = _ xdc1.FirstChild
'Display the contents of the child nodes 'in the Output window Dim int1 As Integer For int1 = 0 To root.ChildNodes.Count - 1Console.WriteLine(FormatCurrency( _ root.ChildNodes(int1).ChildNodes(1). _ InnerText) & ", " & root.ChildNodes(int1). _ ChildNodes(0).InnerText) Next int1
'Reminder that results are in Output window Label1.Text = "See results in Output windows."
End Sub
Learn more about VB.NET programming from either Programming Microsoft SQL Server 2000 with Microsoft Visual Basic .NET or Programming Microsoft Visual Basic .NET for Microsoft Access Databases. Copyright 2003 CAB, Inc. All rights reserved. Republication or redistribution
of CAB, Inc. content, including by framing or similar means, is expressly
prohibited without the prior written consent of CAB, Inc. CAB, Inc. shall not be
liable for any errors in the content, or for any actions taken in reliance
thereon.
|