Retrieving XML file to parse

Discussion in 'Classic ASP' started by tae_mike, Nov 5, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I'm new to ASP and XML, but I'm working on a project that requires it. I've found several samples to retrieve the data, but I can't seem to get any to work.

    I have an ASP page that has two variables to post to a website
    http://www.testserver.com/report?partno=12345&vehicleno=12345

    they require authentication with username and password.

    Then they return an XML file. <xml><vehicles><vehicle name=""></vehicle></vehicles></xml>

    I need to save the xml file to a subdirectory, then start parsing the xml file.

    According to some of the articles, I'm supposed to use winhttp to do the authentication because the asp is run on the server. Then, I'm supposed to use msxml to parse and get my info.

    Can someone get me started? Maybe provide an example of what to use to do the request followed by how to display the name value? I'd be willing to pay if I need to.

    Thanks!

    Mike
     
  2. This is what I have so far. I don't have the component registered yet, so I'm getting that error.

    Otherwise, does this look ok? I'd like to generate the URL dynamically so I can fill in the part info and I need to send the username and password.

    (one.asp)
    <%@language=JScript%>
    <%
    var srvXMLHTTP
    srvXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP");
    srvXMLHTTP.open ("POST", "http://animal1:p[email protected]/report?partno=343201&vehicleno=284071", false);
    srvXmlHttp.send();
    partsElement = srvXMLHTTP.responseXML.selectSingleNode("/VEHICLES/VEHICLE/");
    %>

    <html><p>First Element<p>
    <%Response.Write(partsElement.text);%>
    </body></html>
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page