Posted By: SlackmasterK | Jul 2nd @ 3:10 PM
page 1 of 1
Comments: 8 | Views: 1317
I have a code-behind that looks like this:

protected void Page_Load(object sender, EventArgs e) {
System.IO.StreamReader reader = new System.IO.StreamReader(Request.InputStream);
String xmlData = reader.ReadToEnd();
Response.ContentType = "text/xml";
Response.Write("Pinging back: " + xmlData);
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Flush();
Response.End();
Response.Close();
Response.Write("This should not be sent"); }

It works locally, but when I put it on an IIS Server, all incoming calls return a 405: Method Not Allowed.  How do I configure this application or IIS to allow HTTP POSTs?

It's just an asp.net project; not a web service.

how is this called?

what do you mean when you say "it works locally"  ?  do you mean the VS developer web server? local IIS on XP? Vista?

how are you calling the page / how is it "posted" to ?

the server, is it one you can look at - how is it configured?

How could you write to the response after it has been closed? You should get an error or exception if you try.
If memory serves me correcly IIS disallows POSTing to a "default" document via directory name.  That is to say, "POST /foo/default.aspx HTTP/1.1" works, but "POST /foo/ HTTP/1.1" does not.
Interesting.  If you don't mind, could you also try the following?

http://foo/pingback/ (note the trailing slash)
http://foo/pingback/default.aspx (or whatever your default document is)
http://foo:82/
http://foo:82/default.aspx (or whatever your default document is)

Out of the hazy mists of time I am getting the theory that IIS6 might have (partially?) fixed the default document POST problem.

(disclaimer: I don't work on the IIS team)
page 1 of 1
Comments: 8 | Views: 1317