1
我在VS 2010中使用WCF REST template爲我的應用程序構建RESTful Web服務。我已經完成了所有GET,但現在正在嘗試處理更新,並且即使它顯示在幫助文件中,我仍然在PUT上獲得404。HTTP 404與REST服務中的PUT請求
截斷web.config
:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule"
type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
<validation validateIntegratedModeConfiguration="true" />
<handlers>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" />
</handlers>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
正如你所看到的,所有的動詞爲UrlRoutingHandler啓用。我錯過了什麼?
(請注意,我用的IIS 7,但我不得不運行經典模式的應用程序池以模擬釋放服務器的行爲,這是對IIS 6)