I am confused about all the various methods of handling XML in ASP.Net
2.0. I want to be able to stream XML to some clientside Javascript code
(snippet below):
var urlRequest = "../GetLendersAsXML .aspx"
var request = GXmlHttp.create ();
request.open("G ET", urlRequest, true);
request.onready statechange = function() {
if (request.readyS tate == 4) {
var xmlDoc = request.respons eXML;
I have all the Javascript code I need but I need to have the page above
return XML.
Using SQL 2005 I have created an HTTP endpoint and exposed a stored
procedure as a webservice. I want to add a FOR XML AUTO clause in the
stored procedure to return XML as a big string (that part is easy). The
sproc currently returns a dataset and I've got this code below that
binds it to a GridView (this works but is not what I need):
Partial Class GetLendersAsDat aset
Inherits System.Web.UI.P age
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Try
Dim ws As yukon.ITMO_Lend ers = New yukon.ITMO_Lend ers
Dim ds As System.Data.Dat aSet
ws.Credentials = New System.Net.Netw orkCredential(" myID",
"myPass", "myDomain")
Dim oa As Object()
oa = ws.GetLenderLoc ations("GOLDEN EMPIRE MORTGAGE")
'hardcode example for testing
If oa(1).ToString( ) = "System.Data.Da taSet" Then
ds = DirectCast(oa(1 ), System.Data.Dat aSet)
GridView1.DataS ource = ds.Tables(0)
GridView1.DataB ind()
End If
Catch ex As ApplicationExce ption
Response.Write( ex.ToString)
End Try
End Sub
End Class
So, if I change my stored procedure by adding FOR XML clause, then
ws.GetLenderLoc ations webmethod above will return XML. Can anybody
suggest code for my ASPX page to stream this XML so that my Javascript
at the top of the post can read it?
2.0. I want to be able to stream XML to some clientside Javascript code
(snippet below):
var urlRequest = "../GetLendersAsXML .aspx"
var request = GXmlHttp.create ();
request.open("G ET", urlRequest, true);
request.onready statechange = function() {
if (request.readyS tate == 4) {
var xmlDoc = request.respons eXML;
I have all the Javascript code I need but I need to have the page above
return XML.
Using SQL 2005 I have created an HTTP endpoint and exposed a stored
procedure as a webservice. I want to add a FOR XML AUTO clause in the
stored procedure to return XML as a big string (that part is easy). The
sproc currently returns a dataset and I've got this code below that
binds it to a GridView (this works but is not what I need):
Partial Class GetLendersAsDat aset
Inherits System.Web.UI.P age
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Try
Dim ws As yukon.ITMO_Lend ers = New yukon.ITMO_Lend ers
Dim ds As System.Data.Dat aSet
ws.Credentials = New System.Net.Netw orkCredential(" myID",
"myPass", "myDomain")
Dim oa As Object()
oa = ws.GetLenderLoc ations("GOLDEN EMPIRE MORTGAGE")
'hardcode example for testing
If oa(1).ToString( ) = "System.Data.Da taSet" Then
ds = DirectCast(oa(1 ), System.Data.Dat aSet)
GridView1.DataS ource = ds.Tables(0)
GridView1.DataB ind()
End If
Catch ex As ApplicationExce ption
Response.Write( ex.ToString)
End Try
End Sub
End Class
So, if I change my stored procedure by adding FOR XML clause, then
ws.GetLenderLoc ations webmethod above will return XML. Can anybody
suggest code for my ASPX page to stream this XML so that my Javascript
at the top of the post can read it?
Comment