BrianFord
asked on
Receive and XML document via HTTP Post using VB.NET
I've been trawlling the web for hours trying to see how to receive XML doc that was sent by HTTP POST operation to my web page. But all the examples I'm finding are assuming that I'm sending a request and then processing a response.
In my case I am not sending any request, the data is sent to my web page from a 3rd party vendor using the HTML POST method, and they are not expecting any response.
I need to know how to receive the XML document and parse the data
Any clues?
In my case I am not sending any request, the data is sent to my web page from a 3rd party vendor using the HTML POST method, and they are not expecting any response.
I need to know how to receive the XML document and parse the data
Any clues?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't know what that's about. I have frequently seen code samples like that where one little piece is left out.
respfilepath is the xml file path so u can basically use XElement to load the xml and parse the response via xpath.
if u post the xml i can show how it is done.
if u post the xml i can show how it is done.
ASKER
thank you, i will post the xml later this morning
ASKER
this is the xml I'm receiving:
<?xml version="1.0"?>
-<root><emailAddress>fred@ bill.com</ emailAddre ss>
<fullName>Fred Bloggs</fullName>
<firstName>Fred</firstName >
<lastName>Bloggs</lastName >
<score>123</score>
</root>
there's actually a lot more elements but I cut it down for simplicity :)
<?xml version="1.0"?>
-<root><emailAddress>fred@
<fullName>Fred Bloggs</fullName>
<firstName>Fred</firstName
<lastName>Bloggs</lastName
<score>123</score>
</root>
there's actually a lot more elements but I cut it down for simplicity :)
which data u need to parse from the xml?
u can also create a class which reflect the xml and use deserialization to create the class instance.
u can also create a class which reflect the xml and use deserialization to create the class instance.
ASKER
I need to parse all the data. I need together the field ne and value and save on a database
Thanks
Thanks
ASKER
The other piece of this is how do I return a specific value to the page that sent the http post request in the first place.
Currently my test page just returns: System.Byte[]
Currently my test page just returns: System.Byte[]
ASKER
I've managed to convert this to VB but I'm getting in teh build as it doesn't recognize 'Utility' in the line below
Dim strResonse As String = Utility.ReadResponseFromFi