13/01/2010 Development / asp.net

Segue código abaixo:

Endereço do webService - http://www.webservicex.net/stockquote.asmx?WSDL

Imports System.Xml
Imports System.Data
Imports System.IO

Partial Class _Default

Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim stock As New stockQuote.StockQuote
Dim result As String
Dim xmlReader As System.Xml.XmlTextReader
Dim DS As New DataSet

result = stock.GetQuote(TextBox1.Text)

xmlReader =
New System.Xml.XmlTextReader(result.ToString, System.Xml.XmlNodeType.Document, Nothing)
xmlReader.ReadOuterXml()

DS.ReadXml(xmlReader)
GridView1.DataSource = DS
GridView1.DataBind()

End Sub
End
Class