not able to receive xml data
I am using the serverXMLHTTP object to post data to a third party shipping service (UPS) which uses SSL.
With the serverXMLHTTP object i am able to post data to this server from my asp page, but i am not able to load the returned xml file into the XMLDOM object for parsing. Please help me with this problem.
The code is given below.
Set objXML1 = Server.CreateObject("Microsoft.XMLDOM")
objXML1.validateOnParse = True
Set objXML2 = Server.CreateObject("Microsoft.XMLDOM")
objXML2.validateOnParse = True
objXML1.loadXML(xmlString1)
objXML2.loadXML(xmlString2)
xmlString1 and xmlString2 are two xml strings.
Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.Open "POST", "https://wwwcie.ups.com/ups.app/xml/Rate", false
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.Send objXML1.xml & objXML2.xml
Response.ContentType = "text/xml"
Set objResp = Server.CreateObject("Microsoft.XMLDOM")
objResp.validateOnParse = True
objResp.load(Request)
If objResp.parseError.errorCode <> 0 Then
Response.Write("MyError: " & objResp.parseError.reason & "<br>")
Response.Write("(code: 0x" & hex(objResp.parseError.errorCode) & ")<br>")
Response.Write("At Line " & objResp.parseError.line & ", ")
Response.Write("Position " & objResp.parseError.linepos & " of XML document")
Else
Response.Write("SUCCESS!")
End If
While parsing i get the error : MyError: XML document must have a top level element.
Also when i run the code given below, the xml tags is getting displayed on the browser
Response.Write objHTTP.responsexml.xml
|