I need to setup a web page that listens for XML document via an HTTP POST. I don’t need to POST out, I need to receive that POST. What object does this? Should I use an HTTP handler, web service, webRequest, Stream or something else? I need to use a IIS Server and prefer C#.
I’ve Tried…
-
I dont think I can use WebRequest since I’m not sending a request, just waiting for them.
-
“HttpRequest.InputStream” but I’m not sure how to use it or where to put it. Do i need to use it with a web service or a asp.net application? I put it in
http://forums.asp.net/t/1371873.aspx/1 -
I’ve tried a simple web service http://msdn.microsoft.com/en-us/library/bb412178.aspx – But when i try to visit “http://localhost:8000/EchoWithGet?s=Hello, world!”, i get a “webpage cannot be found error”
If anyone has any helpful code or links that would be great!
EDIT:
I am trying to receive notifications from another program.
You could write an ASP.NET application that you will host in IIS in which you could either have an .ASPX page or a generic .ASHX handler (depending on how you want the result to be formatted – do you want to return HTML or some other type) and then read the
Request.InputStreamwhich will contain the body of the request that comes from the client.Here’s an example of how you could write a generic handler (
MyHandler.ashx):