View Single Post
  #1 (permalink)  
Old September 7th, 2003, 12:34 PM
marabunta marabunta is offline
Registered User
Join Date: Sep 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading XML datastream returned from vendor

I am sending the information from a form to a vendor site. There's a hidden field on the form that is loaded with the well-formed xml when the submit button is clicked. This is then passed to a vendor web site to get a quote. Their system reads this xml from the hidden field (via request.form) and passes pure xml code as the result (with a response.write). There is no other way to communicate with their system except to use their form handler since among other hidden fields are mandatory default fields that rae used to login etc.

My question is this ... how can I capture this XML returned from the form handler so that I can reformat it properly for display?. The returned XML shows up in my browser window but I can't seem to find a way to get to it.

When I use their url directly as the form handler (action=their url) I get the returned XML displayed in my browser ... If I try to replace their form handler with my own (see below)I get a blank page.

ANy help would be greatly appreciated.

I tried using setting the form action to an asp page. Within this asp page I grab all of the for elements and use the MSXML2.ServerXMLHTTP to send the request but it does not seem to be working.

content of the my asp form handler:

    for each sFormElement in Request.Form
         sDataToSend = sDataToSend & "&" & sFormElement & "=" & Server.HTMLEncode(Request.Form(sFormElement))

    sDataToSend = Right(sDataToSend, Len(sDataToSend) - 1)

    strUrl = ""
    strContentType = "application/x-www-form-urlencoded"

    set oXMLHttp = server.Createobject("MSXML2.ServerXMLHTTP")

    Call oXMLHttp.Open("POST", strURL, false)
    Call oXMLHttp.setRequestHeader("Content-Type", strContentType)
    Call oXMLHttp.Send(sDataToSend)

    set oResponseXMLDom = oXMLHttp.ResponseXML

Reply With Quote