Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2005, 11:22 AM
Registered User
 
Join Date: Apr 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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>[email protected]</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>[email protected]</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>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to store "SET" values to Vector ? msg2ajay JSP Basics 1 September 4th, 2007 06:45 AM
DTS Package, XML task. Read XML file and store it Victoria SQL Server DTS 0 July 24th, 2006 02:43 PM
Store Array of Form Values lbunnell Beginning PHP 1 June 21st, 2005 10:13 AM
To split values and store in the database lily611 SQL Server 2000 3 July 15th, 2004 09:01 AM
store multiple values in a string bamboat_3 General .NET 3 May 23rd, 2004 07:32 AM





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