Receive and process a XML post

Discussion in 'ASP General' started by Marja de Vroed, Feb 23, 2006.

  1. I'm trying to build a page which is able to receive and process an XML message that is posted to it by some other page.
    The sending page is working fine, but I don't now how to 'pick up' the sent message in the receiving page.

    Right now I have the following code:

    ' Load the posted XML document.
    Set oXML = Server.Createobject("MSXML2.DOMDocument.4.0")
    oXML.async = False
    oXML.setProperty "ServerHTTPRequest", True
    oXML.load(Request)
    oXML.save Server.MapPath("/uploads/docs/Xml/received.xml")
    Set oXML = Nothing

    I'm trying to write the received XML message to disk, because then I have some evidence that the page did execute. However, no file gets written (the output directory does have write access).
    Since the 'listening' page will never be loaded by a browser, and thus has no "user interface", I don't know how to test the above code other than by trying to write output to some file on disk.

    What am I missing?

    --
    Marja
    Marja de Vroed, Feb 23, 2006
    #1
    1. Advertising

  2. The problem may be that the file doesn't parse properly.

    Using MSXML2.DOMDocument.4.0 as the ProgID will cause MSXML to be fair
    strict about how the file is parsed. (E.g., blank lines preceeding an <?xml
    declaration causes the file not parse).

    You will need to examine the parseError property of the DOM to see why the
    input is being rejected.

    BTW, ServerHTTPRequest property is only necessary of you are going to give
    the load method a URL.


    Anthony.
    Anthony Jones, Feb 23, 2006
    #2
    1. Advertising

  3. Never mind, issue solved. The example code I posted was correct after all.

    There was some more code on in the receiving ASP file that was causing a 500 error.
    Therefore the code I posted here previously wasn't even executed.

    I managed to find this by examining the response status text in the sending page after the send

    --
    Marja
    Marja de Vroed, Feb 23, 2006
    #3
  4. Hi Anthony,

    Thank you for your reply.

    However it turned out that the code I posted here was working fine.
    Something else on the receiving page was causing a problem. (See my other post)

    Regards, Marja
    Marja de Vroed, Feb 23, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    477
    Joerg Jooss
    Dec 15, 2005
  2. Jay
    Replies:
    4
    Views:
    607
  3. Reid Madsen
    Replies:
    8
    Views:
    4,457
    Reid Madsen
    May 16, 2004
  4. John Dow

    How to receive/send XML file through HTTP Post?

    John Dow, Oct 9, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    692
    JIGNESH
    Oct 9, 2007
  5. c676228
    Replies:
    2
    Views:
    742
    c676228
    Oct 24, 2007
Loading...

Share This Page