Solved

Receive and XML document via HTTP Post using VB.NET

Posted on 2013-06-18
10
1,106 Views
Last Modified: 2013-12-13
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
Comment
Question by:BrianFord
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
10 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39257464
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
 

Author Comment

by:BrianFord
ID: 39257548
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
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39257607
Don't know what that's about.  I have frequently seen code samples like that where one little piece is left out.
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 42

Expert Comment

by:sedgwick
ID: 39258520
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
 

Author Comment

by:BrianFord
ID: 39258992
thank you, i will post the xml later this morning
0
 

Author Comment

by:BrianFord
ID: 39261333
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
 
LVL 42

Expert Comment

by:sedgwick
ID: 39261820
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
 

Author Comment

by:BrianFord
ID: 39263575
I need to parse all the data. I need together the field ne and value and save on a database

Thanks
0
 

Author Comment

by:BrianFord
ID: 39266055
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question