Capt. Horatio T.P. Webb
Creating XML on the Client
Parks -- FALL 2000
Last Updated 12PM 9/11/2000

To send XML from the client to the server, we can employ the XMLHTTP component of IE5. The following six lines of VBScript code can be used to send xml:

1
Set xmlsend = CreateObject("Microsoft.XMLHTTP")
this xmlsend object will be used to send the XML using XMLHTTP
2
xmlsend.open "GET", "http://disc-nt.../echoxml.asp", False
this open command establishes three parameters:
  1. the method (i.e., GET or PUT)
  2. the URL of the server's processing program
    In this example we are using "http://auckland.bauer.uh.edu/Students/parks/echoxml.asp"
  3. and the third parameter is whether the transmission is synchronous or not. Typically this parameter is set to false
3
xmlsend.setRequestHeader "Content-type", "text/xml"
Sets the request content-type to xml
4
xmldata="a string respresenting the xml data"
the xml data is loaded into an arbitrary string
5
xmlsend.send xmldata
sends the xml
6
xmlresponse = xmlsend.responseText
receives the result of the server's response

Note that the server-side program must be able to receive the XML file.