473,394 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to return a xmldocument to classic asp


Hi everyone,

I'm making a SOAP request to a webservice from classic
asp with(SOAP Toolkit v3.0).
This function has to return the XML document or the
xmlstring to the classic asp page.
How can i do this?
Here is how i try todo it now:

Public Function getData(ByVal strParamValue As String)
As System.Xml.XmlDocument
Dim connIsOpen As Boolean
Dim strXml As String
Dim xmlDoc As New XmlDocument()
'Dim xmlNodlist As XmlNodeList

strParamValue = strParamValue + "%"
connIsOpen = openConnection()
If connIsOpen Then

Dim RelationCMD As SqlCommand = New SqlCommand
("SELECT Col001, Col002, Col003, Col004,Col005 FROM
EXPortrelatiedetails where Col003 LIKE '" & strParamValue
& "' FOR XML AUTO, ELEMENTS", sqlConn)

'return results to xmltextreader
Dim myXmlResult As System.Xml.XmlTextReader =
RelationCMD.ExecuteXmlReader()

'process xml fragment
myXmlResult.MoveToContent()
Do While myXmlResult.IsStartElement
strXml = strXml & myXmlResult.ReadOuterXml
()
Loop

xmlDoc.LoadXml("<Relations>" + strXml
+ "</Relations>")
xmlDoc.CreateXmlDeclaration("1.0", "iso-8859-
1", Nothing)
'xmlNodlist = xmlDoc.GetElementsByTagName("*")

'Debug.Write(xmlNodlist.Item(0).OuterXml)
getData = xmlDoc 'xmlNodlist.Item(0).OuterXml

myXmlResult.Close()
sqlConn.Close()
sqlConn.Dispose()
End Function

And most important how can i receive this xmlDocument or
xmlstring in classic asp?

Thanxs in advance!

Van Steenbergen Jan
Nov 11 '05 #1
1 6671
How about doing it "by hand" and typing the method on the web service as a
string? Then your classic asp client can receive the string and load it into
an MSXML DOM document object

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

"Van Steenbergen Jan" <ja****************@comit.be> wrote in message
news:06****************************@phx.gbl...

Hi everyone,

I'm making a SOAP request to a webservice from classic
asp with(SOAP Toolkit v3.0).
This function has to return the XML document or the
xmlstring to the classic asp page.
How can i do this?
Here is how i try todo it now:

Public Function getData(ByVal strParamValue As String)
As System.Xml.XmlDocument
Dim connIsOpen As Boolean
Dim strXml As String
Dim xmlDoc As New XmlDocument()
'Dim xmlNodlist As XmlNodeList

strParamValue = strParamValue + "%"
connIsOpen = openConnection()
If connIsOpen Then

Dim RelationCMD As SqlCommand = New SqlCommand
("SELECT Col001, Col002, Col003, Col004,Col005 FROM
EXPortrelatiedetails where Col003 LIKE '" & strParamValue
& "' FOR XML AUTO, ELEMENTS", sqlConn)

'return results to xmltextreader
Dim myXmlResult As System.Xml.XmlTextReader =
RelationCMD.ExecuteXmlReader()

'process xml fragment
myXmlResult.MoveToContent()
Do While myXmlResult.IsStartElement
strXml = strXml & myXmlResult.ReadOuterXml
()
Loop

xmlDoc.LoadXml("<Relations>" + strXml
+ "</Relations>")
xmlDoc.CreateXmlDeclaration("1.0", "iso-8859-
1", Nothing)
'xmlNodlist = xmlDoc.GetElementsByTagName("*")

'Debug.Write(xmlNodlist.Item(0).OuterXml)
getData = xmlDoc 'xmlNodlist.Item(0).OuterXml

myXmlResult.Close()
sqlConn.Close()
sqlConn.Dispose()
End Function

And most important how can i receive this xmlDocument or
xmlstring in classic asp?

Thanxs in advance!

Van Steenbergen Jan

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Tom Leylan | last post by:
(I posted this in languages.vb also... I can't figure out where things go if you use a little of a lot of things) Hi all... I'm looking for an example (or a pointer to one) related to the...
4
by: Jim Mitchell | last post by:
I tried the following to return an XML string, but it did not seem to return XML Any ideas? Thanks in advance. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
2
by: Shailendra Batham | last post by:
hi gurus I have a asp.net web services and in that i have a function which returns XmlDocument as the return value, when I test the service it works fine and I can see the XML. When I try to...
2
by: Richard A. Wells | last post by:
All I wanted to do was implement a web service where I'd receive an XML document and return one in response. I'd already figured out how to use XmlReader and XmlWriter classes to do the XML work I...
1
by: R.A. | last post by:
Hi, I have an web service method that accept an xml document and returns a different xml document. Based on the input xml I fill a dataset with information from a database. If the dataset has...
1
by: Bart Roozendaal | last post by:
Hi, I have setup a (my first) C# assembly. I am using the COM Interop services to use the assembly from a Delphi program. Is there a way to return a XmlDomDocument object from the assembly to...
1
by: shapper | last post by:
Hello, For the past hours I have been trying to solve a problem which is driving me crazy. I have to different codes where the problem to solve is the same: CODE 1 (Transforms a XML...
10
by: Atara | last post by:
Suppose I have the following functions: Public Function myF1ToStream(...) As System.IO.MemoryStream . . . Dim ms As New System.IO.MemoryStream(buf) Return ms End Function Public Function...
11
by: casucci | last post by:
I do a return as XMLDataDocument in my webservice but it returns not with the namespaces etc in them. Anyone have and example where I can have the webservice return it as a XML. C# preferred....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.