Wrox Programmer Forums
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 30th, 2004, 09:00 AM
Registered User
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


    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

        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")

        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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send and Receive XML content through browser kj875 ASP.NET 2.0 Basics 0 July 27th, 2007 12:10 AM
how to send and receive xml data from webService Divesh4u Classic ASP XML 0 May 22nd, 2006 01:10 PM
How to Read and Receive data from a port Vijay_VB VB How-To 1 August 14th, 2004 05:01 AM
about XML receive by tomcatand XML parse by java taianmhzy Servlets 0 May 20th, 2004 01:59 AM
about XML receive ang XML parse by tomcat taianmhzy Apache Tomcat 0 May 20th, 2004 01:56 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.