I have the following code to grab details from a webserver
<%@ LANGUAGE=VBScript%> <% vCustomerUserName = "name" vCustomerPassword = "password" vEventID = 123456 vEmail = "firstname.lastname@example.org" vPassword = "1122334455" Response.Buffer=False Dim MyConnection Dim TheURL ''# Specifying the URL dataURL = "http://www.regonline.com/authorization.asmx/authorizeMemberWithEmailAddress" Set MyConnection = Server.CreateObject("Microsoft.XMLHTTP") ''# Connecting to the URL MyConnection.Open "POST", dataURL, False MyConnection.setRequestHeader "Content-type", "application/x-www-form-urlencoded" ''# Sending and getting data strQueryString = "customerUserName=" & vCustomerUserName & "&customerPassword=" & vCustomerPassword & "&eventID=" & vEventID & "&emailAddress=" & vEmail & "&password=" & vPassword ''# MyConnection.Send MyConnection.Send strQueryString TheData = MyConnection.responseText ''# Set the appropriate content type Response.ContentType = MyConnection.getResponseHeader("Content-type") Response.Write (TheData) Set MyConnection = Nothing %>
If I run this page in a browser it returns what appears to be an xml document. What I need to do is extract the value of a particular node and then send that to the browser in the form
Could anyone please help me this is driving me mad and has taken a LONG time so far to get nowhere. I don't seem to be able to access the reply from the server as an xml document and would appreciate any help.
This will not work if the content type of the response is not set to
application/xml. If this is the case, you can still use MSXML to load the responseText into a DOMDocument and select the data you need.
Another thing to note is that it is generally not recommend to use the XMLHTTP obect from a server side application. It is meant to be used from the client side, because in depends on WinInet. You should use ServerXMLHttp instead. It has the same functionality, but depends on WinHTTP as opposed to WinInet. See the FAQ for more information.