Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 30th, 2004, 09:00 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
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

    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

Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.