title: How can I solve HTTP "404" and "405" error msgs?
body: <p>Are HHTP "404" and "405" errors a step in the right direction following "400" Errors?</p>
  
  <p>After changing my applicationhost.config file, based on step 3 in <a href="http://blogs.msmvps.com/rfennell/2011/03/22/how-to-expose-iis-express-to-external-network-connections-and-use-a-non-self-signed-certificate/" rel="nofollow noreferrer">this article</a>, from this:</p>
  
  <pre><code>&lt;site name="HHS.Web" id="2"&gt;
      &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
          &lt;virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.Web" /&gt;
      &lt;/application&gt;
      &lt;bindings&gt;
          &lt;binding protocol="http" bindingInformation="*:21608:localhost" /&gt;
          &lt;binding protocol="http" bindingInformation="*:21608:shannon2" /&gt;
      &lt;/bindings&gt;
  &lt;/site&gt;
  &lt;site name="HHS.API" id="4"&gt;
      &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
          &lt;virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.API" /&gt;
      &lt;/application&gt;
      &lt;bindings&gt;
          &lt;binding protocol="http" bindingInformation="*:21609:localhost" /&gt;
          &lt;binding protocol="http" bindingInformation="*:21609:shannon2" /&gt;
      &lt;/bindings&gt;
  &lt;/site&gt;
  </code></pre>
  
  <p>...to this:</p>
  
  <pre><code>&lt;site name="HHS.Web" id="2"&gt;
      &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
          &lt;virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.Web" /&gt;
      &lt;/application&gt;
      &lt;bindings&gt;
          &lt;binding protocol="http" bindingInformation="*:21608:" /&gt;
      &lt;/bindings&gt;
  &lt;/site&gt;
  &lt;site name="HHS.API" id="4"&gt;
      &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
          &lt;virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.API" /&gt;
      &lt;/application&gt;
      &lt;bindings&gt;
          &lt;binding protocol="http" bindingInformation="*:21609:" /&gt;
      &lt;/bindings&gt;
  &lt;/site&gt;
  </code></pre>
  
  <p>...and restarting IIS Express after this rigamarole (step 4 in the same article referenced above):</p>
  
  <p><img src="https://i.stack.imgur.com/Ay9t1.png" alt="enter image description here"></p>
  
  <p>....I get when running may app, instead of my previous err ("400 - Bad Request") a different but more common problem: "404 - Not Found"</p>
  
  <p>However, if I enter the URL into IE on the handheld device and run it, I get, "405 - Resource Not Allowed"</p>
  
  <p>Does anybody know how to solve this dilemma / can anybody see a problem with what I'm doing here?</p>
  
  <h2>UPDATE</h2>
  
  <p>As to testing various URLs from the PC's (Chrome) browser, here are what I tried and their results:</p>
  
  <pre><code>// hostname / machine name:
  "http://shannon2:21608/api/inventory/sendxml/bla/bla/bla" gives me:
  </code></pre>
  
  <p><strong><em>HTTP Error 503. The service is unavailable.</em></strong></p>
  
  <pre><code>// IP Address:
  "http://192.168.125.50:21608/api/inventory/sendxml/bla/bla/bla" gives me:
  
  &lt;Error&gt;
  &lt;Message&gt;
  The requested resource does not support http method 'GET'.
  &lt;/Message&gt;
  &lt;/Error&gt;
  
  // locohost:
  "http://localhost:21608/api/inventory/sendxml/bla/bla/bla" gives me the same response as using the IP Address (192.168.125.50) above.
  
  // locohost as IP Address
  "http://127.0.0.1:21608/api/inventory/sendxml/bla/bla/bla" also gives me the same response as using the IP Address (192.168.125.50) or localhost as shown above.
  </code></pre>
  
  <h2>UPDATE 2</h2>
  
  <p>Trying to access the resource via the (IE) browser from the handheld device:</p>
  
  <p>Using <strong>127.0.0.1</strong> within the URL causes the browser to respond with "<em>Cannot find server or DNS error</em>"</p>
  
  <p>Using <strong>192.168.125.50</strong> (my PC's IP Address) responds with "<em>HTTP 405 - Resource not found</em>"</p>
  
  <h2>UPDATE 3</h2>
  
  <p>In the Gretelman post referenced in the answer (<a href="http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx" rel="nofollow noreferrer">here</a>) it says to do this:</p>
  
  <pre><code>netsh http add urlacl url=http://hanselman-w500:80/ user=everyone
  </code></pre>
  
  <p>...from a command prompt; which, in my case, would be: </p>
  
  <pre><code>netsh http add urlacl url=http://shannon2:80/ user=everyone
  </code></pre>
  
  <p>But doesn't that only open attempts to access port 80? I need to access the port the REST Web API method expects, namely 21608...</p>
  
  <p>Should I be doing this:</p>
  
  <pre><code>netsh http add urlacl url=http://shannon2:21608/ user=everyone
  </code></pre>
  
  <p>?</p>
  
  <h2>UPDATE 4</h2>
  
  <p>I can perform the following at a command prompt with no errors:</p>
  
  <pre><code>iisexpress.exe site:"HHS.Web"
  </code></pre>
  
  <p>It is shown as running in IIS Express -- actually, HSS.Web was up prior to running that command (as I could see by right-clicking the IIS Express taskbar icon and selecting "Show All Applications"), along with HHS.API, but I ran it to see if it would return any err msgs, according to what is suggested <a href="https://stackoverflow.com/questions/5433786/configure-iis-express-for-external-access-to-vs2010-project">here</a></p>
  
  <h2>UPDATE 5</h2>
  
  <p>As a follow-up to Update 3 in particular, it was either this:</p>
  
  <pre><code>netsh http add urlacl url=http://shannon2:80/ user=everyone
  </code></pre>
  
  <p>...or this:</p>
  
  <pre><code>netsh http add urlacl url=http://shannon2:8080/ user=everyone
  </code></pre>
  
  <p>...that did the trick - I am now finally able to hit the breakpoint on the server from the handheld after running those commands (opening up ports 80 and 8080 to the masses using my machine's hostName). Which was necessary, or whether they both were, I don't know. I had already added the commands for "21608" and "21609" so they were not the solution:</p>
  
  <p><img src="https://i.stack.imgur.com/lLlBJ.png" alt="enter image description here"></p>