Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6654653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:24:55+00:00 2026-05-26T01:24:55+00:00

I am trying to request xml data from a e-commerce API in ASP classic

  • 0

I am trying to request xml data from a e-commerce API in ASP classic and “transform” the data into new XML and return that data as the response.

This is the ASP script.

<%

product_code = Request.QueryString("product_code")
url = "http://www.the site.com/net/WebService.aspx?Login=name@thehost.com&EncryptedPassword=***********&EDI_Name=Generic\Products&SELECT_Columns=p.ProductCode,p.ProductName,pd.ProductDescriptionShort,pe.ListPrice,pe.ProductPrice,pe.SalePrice&WHERE_Column=p.ProductCode&WHERE_Value=" & product_code
Set xData = CreateObject("Microsoft.XMLHTTP")
xData.Open "get", url, False
xData.Send 
Response.ContentType = "text/xml"
Response.write (xData.responseText)
Set xData = Nothing

%>

Here is a sample of the returned data from the ASP script which calls the API. For instance ifthe above page is called getdata.asp and I call it with http://www.thesite.com/getdata.asp?product_code=m406789 then the following will be returned.

<?xml version="1.0" encoding="UTF-8"?>
<xmldata>
   <Products>
       <ProductCode>M406789</ProductCode>
       <ProductID>858</ProductID>
       <ProductName>M406789 Ignition Box</ProductName>
       <ProductDescriptionShort>&lt;img alt="" src="/v/vspfiles/assets/images/alliance_small.jpg" align="right" /&gt;Ignition Box</ProductDescriptionShort>
       <ListPrice>134.2200</ListPrice>
       <ProductPrice>80.5300</ProductPrice>
       <SalePrice>59.9500</SalePrice>
   </Products>
</xmldata>

What I would like to do is have the returned XML data look like this.

<?xml version="1.0" encoding="UTF-8"?>
<hotspot>
    <ProductCode>M406789</ProductCode>
    <ProductID>858</ProductID>
    <ProductName>M406789 Ignition Box</ProductName>
    <ProductDescriptionShort>&lt;img alt="" src="/v/vspfiles/assets/images/alliance_small.jpg" align="right" /&gt;Ignition Box</ProductDescriptionShort>
    <ListPrice>134.2200</ListPrice>
    <ProductPrice>80.5300</ProductPrice>
    <SalePrice>59.9500</SalePrice>
</hotspot>

Any help or sample code would be much appreciated. Not sure what route to take here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:24:56+00:00Added an answer on May 26, 2026 at 1:24 am

    Could be like this:

    <%
    product_code = Request.QueryString("product_code")
    url = "http://www.the site.com/net/WebService.aspx?Login=name@thehost.com&EncryptedPassword=***********&EDI_Name=Generic\Products&SELECT_Columns=p.ProductCode,p.ProductName,pd.ProductDescriptionShort,pe.ListPrice,pe.ProductPrice,pe.SalePrice&WHERE_Column=p.ProductCode&WHERE_Value=" & product_code
    Set xData = Server.CreateObject("MSXML2.ServerXMLHTTP")
        xData.Open "GET", url, False
        xData.Send
    Dim xNewDoc
    Set xNewDoc = xData.responseXML 'ResponseXml returns DOMDocument object
        With xNewDoc
            .RemoveChild .FirstChild
            .InsertBefore .createProcessingInstruction("xml","version='1.0' encoding='ISO-8859-1'"), .FirstChild
            Set hotspot = .CreateElement("hotspot")
            For Each e In .SelectSingleNode("//Products").ChildNodes
                hotspot.AppendChild e
            Next
            Set .DocumentElement = hotspot
            Response.ContentType = "text/xml"
            Response.Write .Xml
        End With
    Set xNewDoc = Nothing
    Set xData = Nothing
    %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a request using dojo.xhrGet to grab some XML data from
Trying to honor a feature request from our customers, I'd like that my application,
ok so I am trying to parse XML data into a table, this is
I am trying to send a SOAP request from a xml file and send
I am trying to pass data from the database in XML format to an
I'm trying to export data from a web app into excel, but there is
I am receiving a response from a XML request and I need to deal
I'm writing an extension that requests XML content from a server and displays data
I'm trying to return XML from an event complete back to the main function,
Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.