HHTP の "404" および "405" エラーは、"400" エラーに続く正しい方向への一歩ですか?
この記事の手順 3 に基づいて、applicationhost.config ファイルを次のように変更した後:
<site name="HHS.Web" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:21608:localhost" />
<binding protocol="http" bindingInformation="*:21608:shannon2" />
</bindings>
</site>
<site name="HHS.API" id="4">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.API" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:21609:localhost" />
<binding protocol="http" bindingInformation="*:21609:shannon2" />
</bindings>
</site>
...これに:
<site name="HHS.Web" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:21608:" />
</bindings>
</site>
<site name="HHS.API" id="4">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\project\git\CStore\HHS.API" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:21609:" />
</bindings>
</site>
...そして、この rigamarole の後に IIS Express を再起動します (上記で参照した同じ記事の手順 4):
....前のエラー (「400 - Bad Request」) の代わりに、5 月のアプリを実行すると、別のより一般的な問題が発生します: 「404 - 見つかりません」
しかし、ハンドヘルド デバイスの IE に URL を入力して実行すると、「405 - リソースが許可されていません」というメッセージが表示されます。
誰かがこのジレンマを解決する方法を知っていますか/私がここでやっていることに問題があることを誰かが見ることができますか?
アップデート
PC の (Chrome) ブラウザーからさまざまな URL をテストすることに関して、私が試したものとその結果は次のとおりです。
// hostname / machine name:
"http://shannon2:21608/api/inventory/sendxml/bla/bla/bla" gives me:
httpエラー503サービスを利用できません。
// IP Address:
"http://192.168.125.50:21608/api/inventory/sendxml/bla/bla/bla" gives me:
<Error>
<Message>
The requested resource does not support http method 'GET'.
</Message>
</Error>
// 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.
更新 2
ハンドヘルド デバイスから (IE) ブラウザ経由でリソースにアクセスしようとしています:
URL 内で127.0.0.1を使用すると、ブラウザは「サーバーまたは DNS が見つかりません」というエラーを返します。
192.168.125.50 (私の PC の IP アドレス)を使用すると、「 HTTP 405 - Resource not found」で応答します
更新 3
回答で参照されているGretelmanの投稿(here)では、これを行うように指示されています:
netsh http add urlacl url=http://hanselman-w500:80/ user=everyone
...コマンドプロンプトから; 私の場合、これは次のようになります。
netsh http add urlacl url=http://shannon2:80/ user=everyone
しかし、それはポート 80 にアクセスしようとする試みだけを開くのではないでしょうか? REST Web API メソッドが期待するポート、つまり 21608 にアクセスする必要があります...
私はこれを行うべきですか:
netsh http add urlacl url=http://shannon2:21608/ user=everyone
?
更新 4
エラーなしでコマンド プロンプトで次の操作を実行できます。
iisexpress.exe site:"HHS.Web"
IIS Express で実行されているように表示されます。実際には、そのコマンドを実行する前に HSS.Web が起動していました (IIS Express タスクバー アイコンを右クリックして [すべてのアプリケーションを表示] を選択すると確認できました)、HHS.API とともに、しかし、ここで提案されていることに従って、エラーメッセージが返されるかどうかを確認するために実行しました
更新 5
特に Update 3 のフォローアップとして、次のいずれかでした。
netsh http add urlacl url=http://shannon2:80/ user=everyone
...またはこれ:
netsh http add urlacl url=http://shannon2:8080/ user=everyone
...これでうまくいきました。これらのコマンドを実行した後、ハンドヘルドからサーバーのブレークポイントに到達できるようになりました (マシンのホスト名を使用してポート 80 と 8080 を大衆に開放します)。どちらが必要だったのか、それとも両方だったのかはわかりません。「21608」と「21609」のコマンドを既に追加していたため、解決策ではありませんでした。