title: Yet another "The HTTP verb POST used to access path '[my path]' is not allowed"
body: <p>I have check ALL related topics, but nothing was helpful. I do not use url rewriting, I do not click any buttons. My web service expects POST from other service and then it should returns 200 OK with certain payload.</p>
  
  <p>Some of you might say "Ok, the specific servlet does not support post".
  The most confusing thing is that when I send POST from Chrome Simple REST client it works!
  When third party web service sends me the same POST it gives me an error.</p>
  
  <p>Here's what I do, I use ASP.NET development server as web service available to be reached from outside by tunneling (thanks to this <a href="https://stackoverflow.com/questions/18918/can-i-access-asp-net-development-server-in-an-intranet">topic</a>) -> this works from REST client. And then wait for POST which gives me "The HTTP verb POST used to access path 'EndPoint' is not allowed"</p>
  
  <p>Here's web.config</p>
  
  <pre><code>&lt;httpHandlers&gt;   
        &lt;add verb="*" path="EndPoint"
            type="MyHandler" /&gt;     
  &lt;/httpHandlers&gt; 
  </code></pre>
  
  <p>My code that parses POST message and returns the required message:</p>
  
  <pre><code>public class MyHandler : IHttpHandler
  {
      public void ProcessRequest(HttpContext context)
      {
          var stream = context.Request.InputStream;
          byte[] buffer = new byte[stream.Length];
          stream.Read(buffer, 0, buffer.Length);
          string xml = Encoding.UTF8.GetString(buffer);
  
          StringBuilder sb = new StringBuilder();
          XDocument doc = XDocument.Parse(xml);            
  
          var id = XElement.Parse(xml)
              .Descendants("id")
              .First()
              .Value;
  
          string file = "c:/message.xml";            
          XDocument d = XDocument.Load(file);
  
          d.Descendants("context").Where(x =&gt; x.Attribute("id").Value == id).Single().SetAttributeValue("value", "54");
          d.Save(file);  
  
          string responseMessage = @"
              &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;            
              &lt;Message&gt;                
                  &lt;code&gt;Fine&lt;/code&gt; 
              &lt;/Message&gt;
              ";
  
          context.Response.StatusCode = 200;     
          context.Response.AddHeader("Content-Type", "application/xml");
          context.Response.Write(responseMessage);            
  
      }
  </code></pre>
  
  <p>This is log from Tunnel <a href="https://stackoverflow.com/questions/18918/can-i-access-asp-net-development-server-in-an-intranet">monitor</a></p>
  
  <pre><code>&lt;!-- 
  [HttpException]: The HTTP verb POST used to access path &amp;#39;/EndPoint/&amp;#39; is not allowed.
     at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)  at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
  --&gt;
  </code></pre>
  
  <p><strong>EDIT</strong> Answer was straightforward. External service was sending to EndPoint/ instead of subscribed url without "/" i.e. EndPoint. </p>