Make XML Requests Over HTTP (JScript)

 

This tutorial demonstrates how to request an XML data file from a web server using HTTP. The JScript application is a client making the request, and localhost is a local Web server. An XML data file containing contact information (contacts.xml) is stored on the server. The server fulfils the request through an ASP page (contact.asp), which is accessible from the localhost/sxh virtual directory. The request is made in a synchronous call.

This project uses or creates the following files and directories.

Component Description
Source: XMLOverHTTP.cpp This JScript source file retrieves and displays XML data from a Web server.
Virtual Directory: sxh A virtual directory, with a corresponding directory on your drive.
Resource: contacts.xml An XML data file containing contact information.
ASP Page: contact.asp An ASP page that queries a DOM object loaded from the contacts.xml file.
Output You should this output get when you run the XMLOverHTTP project.

To create the XMLOverHTTP JScript project

  1. Create a JScript project. For detailed instructions on how to do this, see Set Up My JScript Project.

  2. Name the project folder XMLOverHTTPProj.

Next, we'll add the source code for this project.