473,325 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Receiving an HTTP Post C#

I need to setup a web page that receives an XML document via an HTTP
post. Should I use an HTTP handler, web service, webRequest, Stream or
something else? In Classic ASP I used the "Request" and it worked.
Any example links would also be helpful.

MAS

Mar 1 '06 #1
9 18510
Thus wrote di***********@gmail.com,
I need to setup a web page that receives an XML document via an HTTP
post. Should I use an HTTP handler, web service, webRequest, Stream
or something else? In Classic ASP I used the "Request" and it
worked. Any example links would also be helpful.


I would say that depends on what kind of XML it is (is it SOAP or Plain Old
XML aka POX?) and what happens with it afterwards (do you simply store it
somewhere or do you need to parse it?).

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 1 '06 #2
Hi,
WebRequest is the easy way.
Web services is better, but a little harder to implement.
It depends on your application needs.
Sharon.

<di***********@gmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
I need to setup a web page that receives an XML document via an HTTP
post. Should I use an HTTP handler, web service, webRequest, Stream or
something else? In Classic ASP I used the "Request" and it worked.
Any example links would also be helpful.

MAS

Mar 1 '06 #3
Plain Old XML (not SOAP). I've got the code written that parses the
XML, just not the part that "catches" it.

The page doesn't make a request out. It sits and waits for a post.
MAS

Mar 1 '06 #4
You can try System.Net.HttpListener.
Sharon.

<di***********@gmail.com> wrote in message
news:11*********************@t39g2000cwt.googlegro ups.com...
Plain Old XML (not SOAP). I've got the code written that parses the
XML, just not the part that "catches" it.

The page doesn't make a request out. It sits and waits for a post.
MAS

Mar 1 '06 #5
HttpListener is not page specific.
WebRequest asks that I request data from a URL.

What I need is a page that receives XML from a POST. I don't need to
POST out, I need to receive that POST. What object does this?

In Classic ASP it was the Request object.

Set oXML = Server.CreateObject("Msxml2.FreethreadedDomDocumen t")
oXML.async = False
oXML.setProperty "ServerHTTPRequest", True
oXML.load(Request)
sPost = oXML.xml

Anyone know the C# equal to these 5 lines of code?

MAS

Mar 2 '06 #6
Thus wrote digitalcolony,
HttpListener is not page specific.
WebRequest asks that I request data from a URL.
What I need is a page that receives XML from a POST. I don't need to
POST out, I need to receive that POST. What object does this?

In Classic ASP it was the Request object.

Set oXML = Server.CreateObject("Msxml2.FreethreadedDomDocumen t")
oXML.async = False
oXML.setProperty "ServerHTTPRequest", True
oXML.load(Request)
sPost = oXML.xml
Anyone know the C# equal to these 5 lines of code?


Read the XML directly from HttpRequest.InputStream, like

protected void UploadButton_Click(object sender, EventArgs e) {
// LoadXml() represents your XML processing code. It should work
// with a System.IO.Stream
LoadXml(Request.InputStream);
}

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 2 '06 #7
Thanks for pointing me in the right direction. InputStream is exactly
what I needed.

string rawXML="";
XmlTextReader reader = null;
reader = new XmlTextReader(Request.InputStream);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(reader);
rawXML = xmlDoc.InnerXml;

MAS

Mar 2 '06 #8
> I need to setup a web page that receives an XML document via an
HTTP
post. Should I use an HTTP handler, web service, webRequest, Stream or something else? In Classic ASP I used the "Request" and it worked. Any example links would also be helpful.

MASaaaaa

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 2 '06 #9
> I need to setup a web page that receives an XML document via an
HTTP
post. Should I use an HTTP handler, web service, webRequest, Stream or something else? In Classic ASP I used the "Request" and it worked. Any example links would also be helpful.

MASaaaa

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 2 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jay Douglas | last post by:
I am trying to do an HTTP POST to a webpage from a DLL. The webpage is easily called, and a response is given. However, the web page is not receiving the POSTed variables. None of them. ...
0
by: Klem | last post by:
I am doing HTTP post and I am receiving the following error: System.IO.IOException: Unable to write data to the transport connection. ---> System.Net.Sockets.SocketException: An established...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
2
by: Dde | last post by:
Hi, Looks like HTTP Poset protocol for Web Services only supports method receiving/sending base types or arry of base types. Is there any work around to this? My ws uses quite complex classes as...
3
by: David Davidson | last post by:
I'm just wondering if anybody's seen a problem with their web server recently that's similar to the following: about two weeks ago some clients on our intranet started experiencing lost sessions -...
10
by: Christina | last post by:
Hello, I need to built a server which receives XML, parses it, and sends some other XML. The client (any XYZ) should be able to post his XML file into my server and my server should send an...
3
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to...
1
by: Arfeen | last post by:
Hi All, I need help again ..... I have an asp.net web page which I hit using the "HTTP POST" method. My ASP.NET page is a basic hello world example with the following code: private void...
6
by: Brybot | last post by:
I am trying to allow HTTP POST file uploads to my web service. Currently I have it working perfectly for a SOAP/XML request reading in a byte using MemoryStream/FileStream but I cannot figure out...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.