Get UPS XML responses to ASP Variable

Hello.

I have code that gets tracking information from UPS via XML code.  The outgoing request and incoming response seem to be functioning correctly.  However , I need to assign the incoming responses to classic ASP variables.  Each response line should be it's own variable named after the <tag>.  Can this be accomplished?  Below is the ASP file I use to send the XML and also a copy of the response.  

PLEASE HELP!
<html>
<head>
<title>Untitled Document</title>
 
</head>
 
------------------------------------------------RESPONSE-------------------------------------------------
- <html>
- <head>
  <title>Untitled Document</title> 
  </head>
  <?xml version="1.0" ?> 
- <TrackResponse>
- <Response>
- <TransactionReference>
  <CustomerContext>gd</CustomerContext> 
  <XpciVersion>1.0001</XpciVersion> 
  </TransactionReference>
  <ResponseStatusCode>1</ResponseStatusCode> 
  <ResponseStatusDescription>Success</ResponseStatusDescription> 
  </Response>
- <Shipment>
- <Shipper>
  <ShipperNumber>5W011F</ShipperNumber> 
- <Address>
  <AddressLine1>1572 GOODYEAR AVE</AddressLine1> 
  <AddressLine2>SUITE D</AddressLine2> 
  <City>VENTURA</City> 
  <StateProvinceCode>CA</StateProvinceCode> 
  <PostalCode>93003 6449</PostalCode> 
  <CountryCode>US</CountryCode> 
  </Address>
  </Shipper>
- <ShipTo>
- <Address>
  <City>BRICK</City> 
  <StateProvinceCode>NJ</StateProvinceCode> 
  <PostalCode>087242704</PostalCode> 
  <CountryCode>US</CountryCode> 
  </Address>
  </ShipTo>
- <ShipmentWeight>
- <UnitOfMeasurement>
  <Code>LBS</Code> 
  </UnitOfMeasurement>
  <Weight>1.00</Weight> 
  </ShipmentWeight>
- <Service>
  <Code>002</Code> 
  <Description>2ND DAY AIR</Description> 
  </Service>
  <ShipmentIdentificationNumber>1Z5W011F0298909629</ShipmentIdentificationNumber> 
  <PickupDate>20080917</PickupDate> 
- <Package>
  <TrackingNumber>1Z5W011F0298909629</TrackingNumber> 
- <Activity>
- <ActivityLocation>
- <Address>
  <City>BRICK</City> 
  <StateProvinceCode>NJ</StateProvinceCode> 
  <PostalCode>08724</PostalCode> 
  <CountryCode>US</CountryCode> 
  </Address>
  <Code>MQ</Code> 
  <Description>PORCH</Description> 
  </ActivityLocation>
- <Status>
- <StatusType>
  <Code>D</Code> 
  <Description>DELIVERED</Description> 
  </StatusType>
- <StatusCode>
  <Code>FS</Code> 
  </StatusCode>
  </Status>
  <Date>20080919</Date> 
  <Time>144600</Time> 
  </Activity>
- <PackageWeight>
- <UnitOfMeasurement>
  <Code>LBS</Code> 
  </UnitOfMeasurement>
  <Weight>1.00</Weight> 
  </PackageWeight>
  </Package>
  </Shipment>
  </TrackResponse>
  <body /> 
  </html>
 
 
<%
strXML = strXML & "<?xml version='1.0'?>"
strXML = strXML & "<AccessRequest xml:lang='en-US'>"
strXML = strXML & "<AccessLicenseNumber>BC30FCBD42744B48</AccessLicenseNumber>"
strXML = strXML & "<UserId>websql08724</UserId>"
strXML = strXML & "<Password>1nt3rn3t</Password>"
strXML = strXML & "</AccessRequest>"
strXML = strXML & "<?xml version='1.0'?> "
strXML = strXML & "<TrackRequest xml:lang='en-US'> "
strXML = strXML & " <Request> "
strXML = strXML & " <TransactionReference> "
strXML = strXML & " <CustomerContext>gd</CustomerContext> "
strXML = strXML & " <XpciVersion>1.0001</XpciVersion> "
strXML = strXML & " </TransactionReference> "
strXML = strXML & " <RequestAction>Track</RequestAction> "
strXML = strXML & " <RequestOption /> "
strXML = strXML & " </Request> "
strXML = strXML & " <TrackingNumber>1Z5W011F0298909629</TrackingNumber> "
strXML = strXML & "</TrackRequest> "
 
Dim xmlhttp 
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP") 
 
 
xmlhttp.Open "POST","https://www.ups.com/ups.app/xml/Track?",false 
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
xmlhttp.send strXML 
 
responsexml = xmlhttp.responseText 
 
response.contenttype = "text/xml"
response.write responsexml
 
 %>
<body>
 
</body>
</html>

Open in new window

JasonJasonJasonJasonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mmaxwell43534Commented:
All you need to do is this:
Dim objXml, address1, address2
Set objXml = CreateObject("MSXML2.DOMDocument")
objXml.Load(xmlhttp.responseXML)
address1 = objXml.getElementsByTagName("AddressLine1").text
address2 = objXml.getElementsByTagName("AddressLine2").text

Open in new window

0
mmaxwell43534Commented:
Also, you may want to do something like this:
If Not objXML.Load(xmlhttp.responseXML) Then
      '''there was an error loading the XML
Else
      '''parse xml here
End If

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.