473,657 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.XmlD ocument
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
EXPortrelatiede tails where Col003 LIKE '" & strParamValue
& "' FOR XML AUTO, ELEMENTS", sqlConn)

'return results to xmltextreader
Dim myXmlResult As System.Xml.XmlT extReader =
RelationCMD.Exe cuteXmlReader()

'process xml fragment
myXmlResult.Mov eToContent()
Do While myXmlResult.IsS tartElement
strXml = strXml & myXmlResult.Rea dOuterXml
()
Loop

xmlDoc.LoadXml( "<Relations >" + strXml
+ "</Relations>")
xmlDoc.CreateXm lDeclaration("1 .0", "iso-8859-
1", Nothing)
'xmlNodlist = xmlDoc.GetEleme ntsByTagName("* ")

'Debug.Write(xm lNodlist.Item(0 ).OuterXml)
getData = xmlDoc 'xmlNodlist.Ite m(0).OuterXml

myXmlResult.Clo se()
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 6703
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.XmlD ocument
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
EXPortrelatiede tails where Col003 LIKE '" & strParamValue
& "' FOR XML AUTO, ELEMENTS", sqlConn)

'return results to xmltextreader
Dim myXmlResult As System.Xml.XmlT extReader =
RelationCMD.Exe cuteXmlReader()

'process xml fragment
myXmlResult.Mov eToContent()
Do While myXmlResult.IsS tartElement
strXml = strXml & myXmlResult.Rea dOuterXml
()
Loop

xmlDoc.LoadXml( "<Relations >" + strXml
+ "</Relations>")
xmlDoc.CreateXm lDeclaration("1 .0", "iso-8859-
1", Nothing)
'xmlNodlist = xmlDoc.GetEleme ntsByTagName("* ")

'Debug.Write(xm lNodlist.Item(0 ).OuterXml)
getData = xmlDoc 'xmlNodlist.Ite m(0).OuterXml

myXmlResult.Clo se()
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
1940
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 following. I have a WebService (it works) that fetches data, turns it into XML and returns it to a vb.net client. The "data" though represents property values for an object which the vb.net client has created and now has to load. Just about every...
4
17914
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
1156
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 call the XML from asp.net, it does not return XmlDocument and gives me this message Cannot implicitly convert type 'System.Xml.XmlNode' to 'System.Xml.XmlDocument' This is my code XmlDocument xd = new XmlDocument();
2
14324
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 need to do. And all that fancy ASP.NET serialization really got in my way. Reading articles by Yasser Shohoud, Tim Ewald, and Matt Powell led me down many promising paths, along the way writing an XSD schema file for my messages, trying to...
1
20925
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 rows then I need to return those rows to the consumer. I can't tell if the consumer of the web service will use .Net or maybe java. 1) If the web service method returns a Dataset then the consumer will get information on the Dataset. What if the...
1
3257
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 the Delphi program? If I try to return the XmlDocument object itself, I get an error like: This type has a ComVisible(false) parent in its hierarchy.
1
1695
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 document using a XSL file): Function Trans()
10
2160
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 mcF2ToXml(. . .) As Xml.XmlDocument . . .
11
2878
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. Flash just sees it as an object when it calls the web service. Thanks
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.