p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XML (http://p2p.wrox.com/forumdisplay.php?f=91)
-   -   store values of recieved xml (http://p2p.wrox.com/showthread.php?t=28220)

Steven1984 April 17th, 2005 11:22 AM

store values of recieved xml
 
Hi,

I hope someone can help me with this:
I am sending a xml file in asp to someone and recieve an answer.
Ok that works fine, but now i have to store the results to a
database. ASP is no problem but i don't have much experience with xml, so help is verry much appreciated!!
I only have to store the download name and link for that itemid and customerid

Thanks in advance!!

What i have now is:

<HTML>
<HEAD>
</HEAD>
<body>

<%

'Put together some XML to post off
xmlString = "<?xml version=""1.0""?>" & vbcrlf
xmlString = xmlString & " <order idorder='9999'>" & vbcrlf
xmlString = xmlString & " <username>Name</username>" & vbcrlf
xmlString = xmlString & " <password>123456</password>" & vbcrlf
xmlString = xmlString & " <email>4lx@gmx.de</email>" & vbcrlf
xmlString = xmlString & " <userip>84.44.148.235</userip>" & vbcrlf
xmlString = xmlString & " <proxyip>84.44.148.235</proxyip>" & vbcrlf
xmlString = xmlString & " <hostname>blank</hostname>" & vbcrlf
xmlString = xmlString & " <country>777</country>" & vbcrlf

xmlString = xmlString & " <product id='5236'> " & vbcrlf
xmlString = xmlString & " <name> Album</name>" & vbcrlf
xmlString = xmlString & " <quantity>1</quantity>" & vbcrlf
xmlString = xmlString & " <price_unit>0.70</price_unit>" & vbcrlf
xmlString = xmlString & " <price_sum>0.70</price_sum>" & vbcrlf
xmlString = xmlString & " </product>" & vbcrlf

xmlString = xmlString & " <product id='5238'> " & vbcrlf
xmlString = xmlString & " <name> Album</name>" & vbcrlf
xmlString = xmlString & " <quantity>1</quantity>" & vbcrlf
xmlString = xmlString & " <price_unit>0.70</price_unit>" & vbcrlf
xmlString = xmlString & " <price_sum>0.70</price_sum>" & vbcrlf
xmlString = xmlString & " </product>" & vbcrlf

xmlString = xmlString & " </order>"

'Load the XML into an XMLDOM object
Set SendDoc = server.createobject("Microsoft.XMLDOM")
SendDoc.ValidateOnParse= True
SendDoc.LoadXML(xmlString)

'Set the URL of the receiver
sURL = "http://www.test.com/testxml/Receive.asp"

'Call the XML Send function (defined below)
set NewDoc = xmlSend (sURL, SendDoc)'xmlString)
'We receive back another XML DOM object!


private function xmlsend(url, docSubmit)
Set poster = Server.CreateObject("MSXML2.ServerXMLHTTP")
poster.open "POST", url, false
poster.setRequestHeader "CONTENT_TYPE", "text/xml"
poster.send docSubmit
Set NewDoc = server.createobject("Microsoft.XMLDOM")
newDoc.ValidateOnParse= True
newDoc.LoadXML(poster.responseTEXT)

Set XMLSend = NewDoc
Set poster = Nothing
end function

%>

</body>
</HTML>


The ruturned xml look like this:


- <test name="ORDER IO">
- <order>
<orderid>46</orderid>
<shopid>1064</shopid>
<customerid>5586</customerid>
<username>name</username>
<password>e8636ea013e682faf61f56ce1cb1ab5c</password>
<email>test@gmx.de</email>
<userip>84.44.148.235</userip>
<proxyip>84.44.148.235</proxyip>
<hostname>xdsl-84-44-148-235.netcologne.de</hostname>
<country>875</country>
<isp>netcologne.de</isp>
- <product id="5236">
<id>5236</id>
<name>album</name>
<article_no>MMR 016-x02</article_no>
<quantity>1</quantity>
<price_selling>0.70</price_selling>
<price_sum>0.7</price_sum>
<download name="album">http://down.test.net:8080/? media=390f1bf71b243843a4f20deafae8261f</download>
</product>
- <product id="5237">
<id>5237</id>
<name>test2</name>
<article_no>MMR 016-x01</article_no>
<quantity>2</quantity>
<price_selling>0.70</price_selling>
<price_sum>1.4</price_sum>
<download name="Album">http://down.test.net:8080/?media=015d8080b3b27f7a60effe51cee706d7</download>
</product>
- <product id="4231">
<id>4231</id>
<name>album 3</name>
<article_no>moh_big_001-x</article_no>
<quantity>1</quantity>
<price_selling>7.00</price_selling>
<price_sum>7</price_sum>
<download name="album 3">http://down.test.net:8080/?media=bcdae67960419625e72f6e27c0ca8b89</download>
</product>
<price_total type="net" currency="#128;" currencytext="EURO">9.1</price_total>
<stats datetime="2005-04-16 01:06:15" exectime="0.62606883049" testing="1" />
</order>
</test>


All times are GMT -4. The time now is 07:59 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.