Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Receive and process a XML post

Reply
Thread Tools

Receive and process a XML post

 
 
Marja de Vroed
Guest
Posts: n/a
 
      02-23-2006
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
 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      02-23-2006
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.


 
Reply With Quote
 
 
 
 
Marja de Vroed
Guest
Posts: n/a
 
      02-23-2006
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
 
Reply With Quote
 
Marja de Vroed
Guest
Posts: n/a
 
      02-23-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
receive xml from https post in classic ASP c676228 ASP General 2 10-24-2007 09:30 PM
How to receive/send XML file through HTTP Post? John Dow ASP .Net Web Services 1 10-09-2007 12:33 PM
Web service that is able to receive a xml "POST" and process it Jay ASP .Net 4 02-09-2006 09:20 PM
Receive a post of XML Document javierperezllanera@gmail.com ASP .Net 3 12-15-2005 08:02 PM
Process does not receive EOF when reading from Process.getOutputStream() Reid Madsen Java 8 05-16-2004 01:37 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57