Note that there are some explanatory texts on larger screens.

plurals
  1. POHosting .NET 4.0 REST WCF service on IIS 5.1 (Windows XP) issue 404 (The resource cannot be found)
    primarykey
    data
    text
    <p>I've got a WCF-based RESTful API (.NET Framework 4.0) which works fine when hosting on IIS 7.0 (Win7) or IIS 6.0 (Server 2003). However, I found a problem hosting the website on IIS 5.1 (Windows XP) which is surprising because I thought 5.1 and 6.0 differ only by the number of hosted websites.</p> <p>Everything is fine with the following request (<a href="http://i.stack.imgur.com/JIuFC.jpg" rel="nofollow">the result screenshot</a>): </p> <blockquote> <p><code>http://localhost/test/api/OrderService.svc</code></p> </blockquote> <p>So I guess I don't have to register any module for handling SVC files or whatsoever. However, the following request (<a href="http://i.stack.imgur.com/DEFtZ.jpg" rel="nofollow">the result screenshot</a>): </p> <blockquote> <p><code>http://localhost/test/api/OrderService.svc/rest/orders?format=json</code></p> </blockquote> <p>returns HTTP code 404. I've checked the event viewer but found nothing.</p> <p>Again, everything works on IIS 7.0 and IIS 6.0. Here is the web.config file (some things cut):</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt; &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt; &lt;add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;globalization uiCulture="auto" /&gt; &lt;customErrors mode="Off" /&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;!--Это приложение определяет конфигурацию в разделе system.web/httpHandlers. Если есть уверенность, что можно игнорировать эту ошибку, сообщение о ней можно отключить, установив для параметра system.webServer/validation@validateIntegratedModeConfiguration значение false. Для запуска приложений ASP.NET на сервере IIS 7.0 и более поздних версий предпочтительным является интегрированный режим.--&gt; &lt;validation validateIntegratedModeConfiguration="false" /&gt; &lt;modules runAllManagedModulesForAllRequests="true"&gt; &lt;remove name="WebDAVModule" /&gt; &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt; &lt;/modules&gt; &lt;handlers&gt; &lt;remove name="WebDAV" /&gt; &lt;add name="AddAsmx" verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add name="AppService" verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;/handlers&gt; &lt;/system.webServer&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="soapBinding" closeTimeout="00:02:00" hostNameComparisonMode="Exact" maxBufferSize="120000" maxReceivedMessageSize="120000" &gt; &lt;security mode="Transport" /&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;webHttpBinding&gt; &lt;binding name="restBinding"&gt; &lt;security mode="Transport" /&gt; &lt;/binding&gt; &lt;!--http://social.msdn.microsoft.com/Forums/en/wcf/thread/845d0bbd-52b4-420f-bf06-793d53ef93ba--&gt; &lt;!--&lt;binding name="poxBinding"&gt; &lt;/binding&gt;--&gt; &lt;/webHttpBinding&gt; &lt;/bindings&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt; &lt;standardEndpoints&gt; &lt;webHttpEndpoint&gt; &lt;!-- Configure the WCF REST service base address via the global.asax.cs file and the default endpoint via the attributes on the &lt;standardEndpoint&gt; element below --&gt; &lt;standardEndpoint name="XDDF" maxBufferSize="120000" maxReceivedMessageSize="120000" helpEnabled="true" automaticFormatSelectionEnabled="true" /&gt; &lt;/webHttpEndpoint&gt; &lt;/standardEndpoints&gt; &lt;services&gt; &lt;service behaviorConfiguration="slBehavior" name="WcfServiceLibrary.OrderService"&gt; &lt;endpoint address="soap" binding="basicHttpBinding" name="basicHttpBinding" bindingConfiguration="soapBinding" contract="WcfServiceLibrary.IOrderService" /&gt; &lt;endpoint address="rest" binding="webHttpBinding" bindingConfiguration="restBinding" behaviorConfiguration="restBehavior" contract="WcfServiceLibrary.IOrderService" /&gt; &lt;!--&lt;endpoint address="pox" binding="webHttpBinding" bindingConfiguration="poxBinding" behaviorConfiguration="poxBehavior" contract="WcfServiceLibrary.IOrderService"/&gt;--&gt; &lt;endpoint address="mex" binding="mexHttpsBinding" name="mexHttpbinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="restBehavior"&gt; &lt;!--&lt;enableWebScript/&gt;--&gt; &lt;webHttp /&gt; &lt;/behavior&gt; &lt;!--&lt;behavior name="poxBehavior"&gt; &lt;webHttp /&gt; &lt;/behavior&gt;--&gt; &lt;/endpointBehaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="slBehavior"&gt; &lt;serviceMetadata httpsGetEnabled="true" /&gt; &lt;serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" /&gt; &lt;/behavior&gt; &lt;behavior name="returnFaults" /&gt; &lt;behavior name=""&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre> <p>Please help. I couldn't find anything that would help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload