Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1229
  • Last Modified:

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?
0
BrianFord
Asked:
BrianFord
  • 5
  • 2
  • 2
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
This article http://www.codeproject.com/Articles/217041/Post-XML-data-From-VB-application-to-ASP-NET-Appli shows how to receive it in C#.  You actually need both sides in order to test your receive application.  I expected to find something like this for VB.NET but after a search, it was not there.  My old ASP.NET book only refers to receiving a POST in the context of a 'postback' from an ASP.NET page.
0
 
BrianFordAuthor Commented:
Thanks ,

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.ReadResponseFromFile(respfilepath)
0
 
Dave BaldwinFixer of ProblemsCommented:
Don't know what that's about.  I have frequently seen code samples like that where one little piece is left out.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Meir RivkinFull stack Software EngineerCommented:
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.
0
 
BrianFordAuthor Commented:
thank you, i will post the xml later this morning
0
 
BrianFordAuthor Commented:
this is the xml I'm receiving:

<?xml version="1.0"?>
-<root><emailAddress>fred@bill.com</emailAddress>
<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 :)
0
 
Meir RivkinFull stack Software EngineerCommented:
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.
0
 
BrianFordAuthor Commented:
I need to parse all the data. I need together the field ne and value and save on a database

Thanks
0
 
BrianFordAuthor Commented:
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[]
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now