Hello I am trying to place an XML Response into an array for easy parsing but im
having a very hard time doing this. Can someone please help me? We are using the SOAP
ToolKit with ASP (Not .NET). If you look at the results you will see that i am getting
back the data but now how do i loop through each "Product"? Below is a snippet of the
VBS I wrote:
Request.VBS
----------------------------------------
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
Set objOutputXMLDoc = CreateObject("MSXML.DOMDocument")
Set fileSys = Createobject ("Scripting.FileSystemObject")
set readfile = filesys.OpenTextFile("C:\Request.xml", 1, false)
contents = readfile.ReadAll
Msgbox contents
objXMLHTTP.open "post", "
False
objXMLHTTP.setRequestHeader "Content-Type", "text/xml"
objXMLHTTP.send contents
Msgbox objXMLHTTP.ResponseText ' <----Got Back Data Please see below for results
----------------------------------------
Results from Call
-------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:n="xmlns:soap="xmlns:soapenc="xmlns:xs="xmlns:xsd1="xmlns:xsi="soap:encodingStyle="Search><result><xsd1
roducts soapenc:arrayType="xsd1
roduct[4]"
xsi:type="soapenc:Array"><item><xsd1:id>911395</xsd1:id><xsd1
artnum>BH0060
84 </xsd1
artnum><xsd1:name>POINTS
</xsd1:name><xsd1:altdesc>POINTS</xsd1:altdesc><xsd1:image>imc/images/tn/010
11.jpg</xsd1:image><xsd1:inventory1>219</xsd1:inventory1><xsd1:inventory2>0<
/xsd1:inventory2><xsd1
rice>1.42</xsd1
rice><xsd1:weight>0.05</xsd1:weight
><xsd1
enumber>01011</xsd1
enumber><xsd1:brand>Bosch</xsd1:brand></ite
>m><i
tem><xsd1:id>911414</xsd1:id><xsd1
artnum>BH006102
</xsd1
artnum><xsd1:name>POINTS (H.P.) </xsd1:name><xsd1:altdesc>POINTS
(H.P.)</xsd1:altdesc><xsd1:image>imc/images/tn/01030.jpg</xsd1:image><xsd1:i
nventory1>1440</xsd1:inventory1><xsd1:inventory2>329</xsd1:inventory2><xsd1:
price>5.10</xsd1
rice><xsd1:weight>0.06</xsd1:weight><xsd1
enumber>010
price>30</
xsd1
enumber><xsd1:brand>Bosch</xsd1:brand></item><item><xsd1:id>993653</xs
d1:id><xsd1
artnum>BH078370 </xsd1
artnum><xsd1:name>POINTS
</xsd1:name><xsd1:altdesc>POINTS</xsd1:altdesc><xsd1:inventory1>219</xsd1:in
ventory1><xsd1:inventory2>0</xsd1:inventory2><xsd1
rice>1.42</xsd1
ric
ventory1>e><x
sd1:weight>0.05</xsd1:weight><xsd1
enumber>01111</xsd1
enumber><xsd1:brand
>Bosch</xsd1:brand></item><item><xsd1:id>919916</xsd1:id><xsd1
artnum>B
>M047
350 </xsd1
artnum><xsd1:name>POINTS, NON HP
</xsd1:name><xsd1:altdesc>POINTS, NON
HP</xsd1:altdesc><xsd1:inventory1>87</xsd1:inventory1><xsd1:inventory2>11</x
sd1:inventory2><xsd1:listPrice>5.21</xsd1:listPrice><xsd1
rice>2.00</xsd1
rice><xsd1:weight>0.05</xsd1:weight><xsd1
enumber>12111267393</xsd1
en
rice>umbe
r><xsd1:brand>Bremi</xsd1:brand></item></xsd1
roducts></result></n
art
r>numb
erSearch></soap:Body></soap:Envelope>
-----------------------------------------------
Gordon R. Durgha
gd@vslink.net
having a very hard time doing this. Can someone please help me? We are using the SOAP
ToolKit with ASP (Not .NET). If you look at the results you will see that i am getting
back the data but now how do i loop through each "Product"? Below is a snippet of the
VBS I wrote:
Request.VBS
----------------------------------------
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
Set objOutputXMLDoc = CreateObject("MSXML.DOMDocument")
Set fileSys = Createobject ("Scripting.FileSystemObject")
set readfile = filesys.OpenTextFile("C:\Request.xml", 1, false)
contents = readfile.ReadAll
Msgbox contents
objXMLHTTP.open "post", "
False
objXMLHTTP.setRequestHeader "Content-Type", "text/xml"
objXMLHTTP.send contents
Msgbox objXMLHTTP.ResponseText ' <----Got Back Data Please see below for results
----------------------------------------
Results from Call
-------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:n="xmlns:soap="xmlns:soapenc="xmlns:xs="xmlns:xsd1="xmlns:xsi="soap:encodingStyle="Search><result><xsd1
xsi:type="soapenc:Array"><item><xsd1:id>911395</xsd1:id><xsd1
84 </xsd1
</xsd1:name><xsd1:altdesc>POINTS</xsd1:altdesc><xsd1:image>imc/images/tn/010
11.jpg</xsd1:image><xsd1:inventory1>219</xsd1:inventory1><xsd1:inventory2>0<
/xsd1:inventory2><xsd1
><xsd1
>m><i
tem><xsd1:id>911414</xsd1:id><xsd1
</xsd1
(H.P.)</xsd1:altdesc><xsd1:image>imc/images/tn/01030.jpg</xsd1:image><xsd1:i
nventory1>1440</xsd1:inventory1><xsd1:inventory2>329</xsd1:inventory2><xsd1:
price>5.10</xsd1
price>30</
xsd1
d1:id><xsd1
</xsd1:name><xsd1:altdesc>POINTS</xsd1:altdesc><xsd1:inventory1>219</xsd1:in
ventory1><xsd1:inventory2>0</xsd1:inventory2><xsd1
ventory1>e><x
sd1:weight>0.05</xsd1:weight><xsd1
>Bosch</xsd1:brand></item><item><xsd1:id>919916</xsd1:id><xsd1
>M047
350 </xsd1
</xsd1:name><xsd1:altdesc>POINTS, NON
HP</xsd1:altdesc><xsd1:inventory1>87</xsd1:inventory1><xsd1:inventory2>11</x
sd1:inventory2><xsd1:listPrice>5.21</xsd1:listPrice><xsd1
rice><xsd1:weight>0.05</xsd1:weight><xsd1
rice>umbe
r><xsd1:brand>Bremi</xsd1:brand></item></xsd1
r>numb
erSearch></soap:Body></soap:Envelope>
-----------------------------------------------
Gordon R. Durgha
gd@vslink.net